c# - custom filter in kendo grid datasource -
in kendo grid loading data
.grid<portals.areas.reports.models.transactionreportitem>()
like this. again provided in datasource
.datasource(datasource => datasource .ajax() .pagesize(100) .read(read => read.action("gettransactions","transactions")))
my problem when provided external filter, because of datasource
displaying data instead of filter data. question how can apply external filter condition in data source or possible stop calling datasource
? using server side grid control
.
on read
action add this:
.read(read => read.action("gettransactions","transactions").data(getdatafilters))
.data()
call function give every time read
action occurs.
<scrip> function getdatafilters() { // add values filters variables. var filterfield1 = $('#filterfield1').val(); var filterfield2 = $('#filterfield2').val(); // set values of model return { modelfieldname1: filterfield1, modelfieldname2: filterfield2 } } </script>
make sure have parameter set in gettransactions
action hold data. don't know how controller set up, can see fields have filter on them, set where
clause when grab data.
Comments
Post a Comment