我目前正在尝试使用GridX在我的应用程序中显示表格数据。我使用JsonRest作为商店,异步缓存和分页。服务器被正确调用并且结果正确(例如:items = 10-20,response:items = 10-20/30)并且数据是不同的。GridX需要数字ID吗?
但是表格总是在每个页面上重复显示一行(10次,如果页面大小为10)。 GridX的模型非常复杂,但我似乎需要某种行标识符(我在某处读过它应该是数字)。我的应用程序根本没有这个数据数字标识符。有没有可能使用gridX,或者我有一些配置错误?
var store = new JsonRest({target: activitiesResource});
var columns = [
{name: "AAA", field: "aaa", sortable: false},
{name: "BBB", field: "bbb"}
];
//Create grid widget.
var grid = new Grid({
id: 'grid',
cacheClass: Async,
pageSize: 25,
autoHeight: true,
store: store,
cacheSize: -1,
structure: columns,
modules: [
Pagination,
PaginationBar
]
);
//Put it into the DOM tree. Let's assume there's a node with id "gridContainer".
grid.placeAt('htmlGrid');
//Start it up.
grid.startup();
在此先感谢。