我正在使用ignites ig.datasource:
ds = new $.ig.DataSource({
type: "json",
callback: renderTable,
dataSource: js,
paging: {
enabled: true,
pageSize: 10,
type: "local"
},
schema: jsonSchema,
filtering: {
type: "local",
},
});
点击单选按钮我正在过滤..
$(document).change('input:radio[name="inlineRadioOptions"]', function (e) {
var t = e.target.value;
ds.filter([{
fieldName: "Type", expr: t, cond: "equals"
}], "AND", true);
ds.dataBind();
});
这会返回ds中的filteredData,但我似乎无法使用这些值重新绑定网格。请参见附图。
谢谢..
答案 0 :(得分:3)
如何使用初始数据源中的filtered data创建新数据源?
newDS = new $.ig.DataSource({
type: "json",
callback: renderTable,
dataSource: ds.filteredData(),
paging: {
enabled: true,
pageSize: 10,
type: "local"
},
schema: jsonSchema,
filtering: {
type: "local",
},
});
然后使用newDS
创建/重新创建/重新绑定igGrid。