dojo gridx 装载数据
GridX 是一个基于 Dojo 的高性能、可扩展的表格控件。要加载数据到 GridX 中,需要进行以下步骤:
- 创建 GridX 的实例:
var grid = new Grid({
id: 'grid',
cacheClass: Cache,
store: store,
structure: columns
}, 'gridContainer');
其中,store 是数据源,columns 是表格的列定义。
- 加载数据:
grid.startup();
此时,GridX 会自动从 store 中加载数据,并按照 columns 定义的列来展示数据。
- 可以在数据加载后对 GridX 进行各种操作,例如排序、过滤、分页、编辑等。
grid.sort.sort([{attribute: "name", descending: true}]);
grid.filter.setFilter({name: 'John'});
grid.pagination.gotoPage(2);
grid.edit.apply();
以上是 GridX 加载数据的基本流程,具体的实现方式可以参考 GridX 的文档和示例代码
原文地址: https://www.cveoy.top/t/topic/g9qR 著作权归作者所有。请勿转载和采集!