Kendo ui KendoUi网格加载数据需要事件触发的顺序
我知道剑道数据源中触发了什么事件,但我想知道是否有人有事件触发顺序的列表。我试图在read()和refresh()之后重新过滤网格,但似乎无法使代码正常工作。它通过更改事件保存得很好,但我不知道在哪里实际尝试并将过滤器插入到网格中,这样它将被过滤,与保存前一样Kendo ui KendoUi网格加载数据需要事件触发的顺序,kendo-ui,kendo-grid,Kendo Ui,Kendo Grid,我知道剑道数据源中触发了什么事件,但我想知道是否有人有事件触发顺序的列表。我试图在read()和refresh()之后重新过滤网格,但似乎无法使代码正常工作。它通过更改事件保存得很好,但我不知道在哪里实际尝试并将过滤器插入到网格中,这样它将被过滤,与保存前一样 dataSource: { type: "json",
dataSource: {
type: "json",
serverSorting: false,
batch: true,
pageSize: 50,
change: function(e) {
dataSource = $("#grid").data("kendoGrid").dataSource;
saveFilters = dataSource.filter();
sessionStorage.setItem('theGridFilters', JSON.stringify(saveFilters));
console.log("save: " + JSON.stringify(saveFilters) );
},
transport: {
read: {
url: "./grid_projectselections.php?delob=" + escape(lob),
dataType: "json",
cache: false,
complete: function () {
}
},
update: {
url: "./update_projectselections.php?delob=" + escape(lob),
dataType: "json",
complete: function () {
$("#grid").data("kendoGrid").dataSource.read();
$("#grid").data("kendoGrid").refresh();
}
},
parameterMap: function(options, operation) {
if (operation !== "read" && options.models) {
return {models: kendo.stringify(options.models)};
}
}
},
requestEnd: function(e) {
if (e.type != undefined ) {
if ( e.type === 'read' ) {
hidesavingpanel();
}
}
},
schema: {
data: "data",
total: "total",
model: {
id: "RowID",
fields: {
RowID: {editable: false},
ProjectID: {editable: false},
ProjectName: {editable: true},
HostCount: {editable: false},
HR_LEVEL_5: {editable: false},
HR_LEVEL_6: {editable: false},
HR_LEVEL_7: {editable: false},
HR_LEVEL_8: {editable: false},
HR_LEVEL_9: {editable: false},
OrgDescr: {editable: false},
GroupDescr: {editable: false},
RegionDescr: {editable: false},
SectionDescr: {editable: false}
}
}
},
},
saveChanges: function(e) {
var g = $('#grid').data('kendoGrid');
var data = g.dataSource.view();
var isdirty = false;
$.each(data, function (i, item) {
if (item.dirty) {
isdirty = true;
}
});
if ( isdirty === false ) {
return true;
}
showsavingpanel();
},
使用远程操作时的顺序如下:
dataSource.requestStart
dataSource.requestEnd
dataBinding
dataBound
dataSource.change
所有这些都列在列表中。您还可以使用以下命令。我不确定您想要实现什么,但我怀疑您正在试图保持所解释的网格状态。谢谢您的帮助。。。我有一个自定义工具栏按钮,可以对用户的筛选行执行一些批量数据库更新。更新完成后,我调用另一个read();在数据源上,以提取更新的数据。一旦发生这种情况,用户先前选择的过滤器就会消失。我已经尝试了所有我能想到的方法来重新过滤记录,使其与批量更新和读取之前选择的内容相匹配。