Extjs4 gridpanel行数据与json数据存储不同

时间:2012-05-08 02:30:30

标签: extjs gridpanel

我是extjs4的新手,我有一个gridpanel的问题,应该显示来自数据存储的行数。我的问题是数据存储检索json有6行,但为什么在网格面板中只显示4行...

这是网格

Ext.create('Ext.grid.Panel', {
        id: 'gridcb',
        store: Ext.data.StoreManager.lookup('mystore'),
        columns: [
            {header: 'ci',  dataIndex: 'co'},
            {header: 'co', dataIndex: 'co', flex:1},
            {header: 'durasi', dataIndex: 'durasi'},
            {header: 'issue', dataIndex: 'id'}
        ],
        height: 200,
        width: 400,
    });

这是商店

var mystore = Ext.create('Ext.data.Store', {

        storeId:'mystore',
        fields:['ci', 'co', 'durasi', 'id'],
        proxy: {
            type: 'ajax',
            url : 'exe_report_issue_order.php?function=store',
            actionMethods : 'POST',
            reader: {
                type: 'json',
                root: 'rows'
            }
        }
    });

和json返回6行唯一。为什么只显示4行...

{success:true,
rows:[{ "ci":"2012-04-17 17:13:48",
        "co":"2012-04-17 17:13:59",
        "durasi":"00:00:11",
        "id":"154"
        },
        {"ci":"2012-04-26 08:05:00",
         "co":"2012-04-26 10:00:00",
         "durasi":"01:55:00",
         "id":"157"
        },
        {"ci":"2012-04-26 13:00:00",
         "co":"2012-04-26 17:00:00",
         "durasi":"04:00:00",
         "id":"158"
        },
        {"ci":"2012-04-17 13:00:00",
         "co":"2012-04-17 17:00:00",
         "durasi":"04:00:00",
         "id":"65"
        },
        {"ci":"2012-04-18 08:00:00",
         "co":"2012-04-18 10:00:00",
         "durasi":"02:00:00",
         "id":"65"
        },
        {"ci":"2012-04-18 17:45:00",
          "co":"2012-04-18 22:00:00",
          "durasi":"04:15:00",
          "id":"65"
        },
        {"ci":"2012-04-18 23:30:00",
         "co":"2012-04-19 03:30:00",
         "durasi":"-20:00:00",
         "id":"65"
        }
    ]

}

有人可以向我解释吗???拜托。 感谢

1 个答案:

答案 0 :(得分:2)

您的商店中不能包含重复ID的商品,它们必须是唯一的。