Grid having 3 options 1) My filters - Which are saved by me 2) Shared filters - which are shared by others 3) All - Both my and shared
I want to display grid with result default to my filters. I have loaded all filters at once, By default it must show my filters records, but showing all filters records. On selection of respective options mentioned above, grid loads data properly. Problem is only with default my filters Please help me.
I recommend you to upgrade old jqGrid 4.6 to the current version of free jqGrid. See here more details about the usage of free jqGrid. After the upgrade you can use the following options
datatype: "json",
loadonce: true,
forceClientSorting: true // force local sorting and filtering
search: true, // to apply the filter from postData.filters
postData: {
// the filters property is the filter, which need be applied
// to the data loaded from the server
filters: JSON.stringify({
groupOp: "OR",
rules: [
{ field: "shared_by", op: "eq", data: " " },
{ field: "shared_by", op: "eq", data: login_user_id }
]
})
},
...
the exact value of the postData.filters
depends on the data saved on the server. As an example of usage see the demo https://jsfiddle.net/OlegKi/epcz4ptq/, created for the old answer. See another old answer for additional information.