有时需要两个Gridx联动,需要Gridx重置。
var target, pStore;
target = "/Api/EmployeesPost/Get?userid=admin&userdept=MM0001";
pStore = new Store(new JsonRestStore({ idProperty: "ID", target: target }), new Memory());
if (gridPost) {
gridPost.model.clearCache(); //清空
gridPost.setStore(pStore); //重置
gridPost.body.refresh(); //刷新界面
} else {
gridPost = new Grid({
cacheClass: Cache,
store: pStore,
structure:
[
{ field: "SelPost", name: "选中", width: "26px", dataType: "boolean", widgetsInCell: true,
decorator: function () {
return '<span data-dojo-type="dijit.form.CheckBox" data-dojo-attach-point="cb"></span>';
},
setCellValue: function (data) {
this.cb.set('value', data);
}
},
{ field: "ID", name: "岗位编号" },
{ field: "Name", name: "岗位名称" }
],
modules:
[
CellWidget
],
autoHeight: true
});
gridPost.placeAt("gridContainerPost");
gridPost.startup();
}
Gridx就像dojo一样入门非常难,希望没有选错!