javascript - Kendo grid: How to remote filter above 2 values from one column -
I have a column in the condo grid but if I'm filtering in front of server API, then filtering me against two values
It means something like this:
{"entityName": "customer", "data": {"le": 10, "skip": 0 , "Page" ": 1," page size ": 10," filter ": {" logic ":" and ", // IN filter is important for 2 objects" filter ": [{" operator ":" Eq "," value "," test "," field ":" client.name "}, {" operator ":" eq "," value ":" test ", "Field": "client.surname"}]}, "group": []}} I tried it like this:
Filterable: {cell: [{dataTextField: "client.name", operator: "included"}, {DataTextField: "client.surname", operator: "included"}]} But without luck.
How can I do this?
Many thanks for any advice.
To do this, you must stop the data source data request and change the filter within the reading option before receiving the serverYou must create a custom transport.read and every time the datasource will request some data, the reading option will pass the parameter to that function.
myGridCando grid ({data source: {serverFiltering: true, transport: {read: function (readOptions) {readOptions.filter.filters = [{operator: "eq", value: "test ", Field:" client.name "}, {operator:" eq ", value:" test ", field:" client.surname "}]; / You can also attempt to call the data source on the original read function. Modified read option / Ajax is just an example ... $ .ajax ({data: reading options}) (function (data) {readOptions.success ( )}}}}}} Remember that if you overwrite the reading task, you are responsible for calling readOptions su data about the data callback The ccess / error function to notify the source.
Comments
Post a Comment