I am using SmartClient v110p_2016_09-08 (LGPL)
I am trying to filter listgrid data locally :-
Data Source
---------------
isc.RestDataSource.create({
ID:"StudentDataSource",
dataFormat:"json",
operationBindings:[
{operationType:"add", dataURL:"api/Student", dataProtocol:"postMessage"},
{operationType:"fetch", dataURL:"api/Student", dataProtocol:"getParams"},
{operationType:"update",dataURL:"api/Student",dataProtocol:"postMessage",requestProperties:{httpMethod:"PUT"}}
],
fields:[
{name:"id", primaryKey:true},
{name:"name"},
{name:"age"}
]
});
List Grid
----------
isc.ListGrid.create({
ID:"StudentOldListGrid",
dataSource:"StudentDataSource",
autoDraw:false,
width:"500",
height:"500",
autoFetchData:false,
filterLocalData:true,
showFilterEditor:true,
filterOnKeypress:true,
fields:[
{name:"id"},
{name:"name"},
{name:"age", type:"int"}
]
});
As per document I am setting data using "setData" as below
StudentDataSource.fetchData(null, "StudentOldListGrid.setData(data)");
All data is loaded into grid correctly. When I try to filter data using filter editor, it again issues a server fetch passing criteria "/api/Student?name=R&_operationType=fetch". After this fetch code filters data locally until I clear all data. The question I have is that as I have already provided all the data using setData why smartclient is issuing additional fetch (when it has all data already). The problem I have with this is that I need to implement all filter logic at server side as well due to that fetch which I don't want to and because of which I am using filterLocalData at first place. P.S. I am seeing warning "*14:36:08.319:TMR1:WARN:Log:createDataModel method: data should be an array" before this fetch occurs.
I am trying to filter listgrid data locally :-
Data Source
---------------
isc.RestDataSource.create({
ID:"StudentDataSource",
dataFormat:"json",
operationBindings:[
{operationType:"add", dataURL:"api/Student", dataProtocol:"postMessage"},
{operationType:"fetch", dataURL:"api/Student", dataProtocol:"getParams"},
{operationType:"update",dataURL:"api/Student",dataProtocol:"postMessage",requestProperties:{httpMethod:"PUT"}}
],
fields:[
{name:"id", primaryKey:true},
{name:"name"},
{name:"age"}
]
});
List Grid
----------
isc.ListGrid.create({
ID:"StudentOldListGrid",
dataSource:"StudentDataSource",
autoDraw:false,
width:"500",
height:"500",
autoFetchData:false,
filterLocalData:true,
showFilterEditor:true,
filterOnKeypress:true,
fields:[
{name:"id"},
{name:"name"},
{name:"age", type:"int"}
]
});
As per document I am setting data using "setData" as below
StudentDataSource.fetchData(null, "StudentOldListGrid.setData(data)");
All data is loaded into grid correctly. When I try to filter data using filter editor, it again issues a server fetch passing criteria "/api/Student?name=R&_operationType=fetch". After this fetch code filters data locally until I clear all data. The question I have is that as I have already provided all the data using setData why smartclient is issuing additional fetch (when it has all data already). The problem I have with this is that I need to implement all filter logic at server side as well due to that fetch which I don't want to and because of which I am using filterLocalData at first place. P.S. I am seeing warning "*14:36:08.319:TMR1:WARN:Log:createDataModel method: data should be an array" before this fetch occurs.
Comment