0

テキストボックス、ボタン、ListView で構成されるパネルがあります。リストを除いて、これは正しく設定されていると思います。リストビューは、ストアからのデータでは表示されません。次のように追加しようとしています。

Ext.define('Abc.view.Trains', {
extend: 'Ext.Panel',
xtype:'searchtrains',
requires: [ 'Ext.dataview.List','Ext.Label','Ext.form.FieldSet'
'Abc.view.SearchTrainResults','Abc.view.SampleList'],
config: {
    title: 'Train Enquiry',
    items: [


        {
            xtype: 'fieldset',
            style:'width:74%;  float:left',
            margin:'10px',
            items: 
                {
                    xtype: 'textfield',
                    placeHolder: 'Username',
                    itemId: 'trainNoTextField',
                    name: 'trainNoTextField',
                    required: true
            }

        },
        {
            xtype: 'button',
            itemId: 'trainSearchButton',
            ui: 'action',
            padding: '10px',
            text: 'Go',
            style:'width:20%; margin-top:10px; float:right'
        },
        {
            xtype: 'sampList',
        }
     ]
    ]};

Abc/view/SampleList

  Ext.define('Abc.view.SampleList', {
extend: 'Ext.List',
xtype: 'sampList',
requires: ['TrainEnquiry.store.SampleList'],

config: {
    title: 'Train Enquiry',
        itemTpl: '<div class="myContent">'+ 
                '<div><b>{status}</b> </div>' +
                '</div>',
        store: 'SampleList',
},
});

Abc/店舗/SampleList

  Ext.define('Abc.store.SampleList', {
extend: 'Ext.data.Store',

config: {
    fields: ['status'],
    data: [
        { status: "Live! Train Statusjhgkbvdsbvfbnsdfvsdgfjasdgjhagsdhjasgdahjsgdjhasdbahjsgdsajhdgahjsgdashdgajhsdgajhsdvahjsdg" },
        { status: "Live! Station Statustusjhgkbvdsbvfbnsdfvsdgfjasdgjhagsdhjasgdahjsgdjhasdbahjsgdsajhdgahjsgdashdgajhsdgajhsdvahjsdg" },
        { status: "Train Time Tabletusjhgkbvdsbvfbnsdfvsdgfjasdgjhagsdhjasgdahjsgdjhasdbahjsgdsajhdgahjsgdashdgajhsdgajhsdvahjsdg"}
    ]
}
});
4

2 に答える 2

0

このようなもの?

Ext.define('Abc.view.Trains', {
extend: 'Ext.Panel',
xtype:'searchtrains',
requires: ['Ext.dataview.List','Ext.Label','Ext.form.FieldSet','Abc.view.SampleList'],
config: {
title: 'Train Enquiry',
layout:'vbox',
items: [
{
    flex:1,
    xtype:'panel',
    layout:'hbox',
    items:[{
        flex:2,
        xtype: 'fieldset',
        style:'width:74%;  float:left',
        margin:'10px',
        items: 
        {
            xtype: 'textfield',
            placeHolder: 'Username',
            itemId: 'trainNoTextField',
            name: 'trainNoTextField',
            required: true
        }
    },{
        flex:1,
        xtype: 'button',
        itemId: 'trainSearchButton',
        ui: 'action',
        padding: '10px',
        text: 'Go',
        style:'width:20%; margin-top:10px; float:right'
    }]
},{
    flex:10,
    xtype: 'sampList',
}]
}
});
于 2013-03-06T12:31:07.983 に答える
0

コードをコピーしたばかりの場合は、'Ext.form.FieldSet' の後にカンマを追加するのを忘れた可能性があります。

requires: [ 'Ext.dataview.List','Ext.Label','Ext.form.FieldSet'
'Abc.view.SearchTrainResults','Abc.view.SampleList'],

私は次のことに疲れました、そしてそれは私のために働きました:

view\Trains.js

Ext.define('Abc.view.Trains', {
extend: 'Ext.Panel',
xtype:'searchtrains',
requires: ['Ext.dataview.List','Ext.Label','Ext.form.FieldSet','Abc.view.SampleList'],
config: {
title: 'Train Enquiry',
layout:'vbox',
items: [
{
    flex:1,
        xtype: 'fieldset',
        style:'width:74%;  float:left',
        margin:'10px',
        items: 
            {
                xtype: 'textfield',
                placeHolder: 'Username',
                itemId: 'trainNoTextField',
                name: 'trainNoTextField',
                required: true
        }

    },
    {
    flex:1,
        xtype: 'button',
        itemId: 'trainSearchButton',
        ui: 'action',
        padding: '10px',
        text: 'Go',
        style:'width:20%; margin-top:10px; float:right'
    },
    {
    flex:1,
        xtype: 'sampList',
    }
]}
});

view\SampleList.js

Ext.define('Abc.view.SampleList', {
extend: 'Ext.List',
xtype: 'sampList',
requires: ['Abc.store.SampleList'],

config: {
    title: 'Train Enquiry',
    itemTpl: '<div class="myContent">'+ 
            '<div><b>{status}</b> </div>' +
            '</div>',
    store: 'SampleList',
},
});

store\SampleList.js

Ext.define('Abc.store.SampleList', {
extend: 'Ext.data.Store',

config: {
fields: ['status'],
data: [
    { status: "Live! Train Statusjhgkbvdsbvfbnsdfvsdgfjasdgjhagsdhjasgdahjsgdjhasdbahjsgdsajhdgahjsgdashdgajhsdgajhsdvahjsdg" },
    { status: "Live! Station Statustusjhgkbvdsbvfbnsdfvsdgfjasdgjhagsdhjasgdahjsgdjhasdbahjsgdsajhdgahjsgdashdgajhsdgajhsdvahjsdg" },
    { status: "Train Time Tabletusjhgkbvdsbvfbnsdfvsdgfjasdgjhagsdhjasgdahjsgdjhasdbahjsgdsajhdgahjsgdashdgajhsdgajhsdvahjsdg"}
]}
});

index.html

<html>
<head>
    <link href="sencha-touch.css" rel="stylesheet" type="text/css">
    <script type="text/javascript"  src="sencha-touch-all-debug.js"></script>
    <link rel="stylesheet" href="resources/css/app.css" type="text/css">
</head>

<body>
    <script type="text/javascript">

Ext.application(
{
    name: 'Abc',
    views: ['Trains','SampleList'],
    stores:['SampleList'],

    launch: function() 
    {
        Ext.Viewport.add(Ext.create('Abc.view.Trains'));    
    }
});

    </script>
</body>
</html>
于 2013-03-06T11:43:06.937 に答える