MonOve
MonOve

Reputation: 1101

Hide Column, but display its filter, in Kendo Grid

I am looking to create a bunch of filters on a Kendo Grid but these filters are for hidden columns.

I want to display the filter (perhaps moving it outside the grid area with jQuery) but keep the entire column hidden.

Any suggestions?

Upvotes: 1

Views: 3333

Answers (1)

Petur Subev
Petur Subev

Reputation: 20193

Use the dataSource.filter method for that implementation.

        $('#GridName').data().kendoGrid.dataSource.filter({field:"hiddenColumnName",operator:"gt",value:42});

If for some reason you want to extract these filter descriptors from the Grid you can use the filter method without parameters. An object will be returned which will contain how exactly the Grid is filtered.

Please notice that this approach does not even require to have the columns hidden (you can skip declaring them at all). The whole objects (with all fields) are available by default on the client.

Upvotes: 4

Related Questions