precious
precious

Reputation: 117

Is both client and server column filters in ag grid possible?

I want to know if we can do combination filtering in ag grid. Some volumn filtering on client and some on server. is that possible?

I was checking adaptabletools website they have built similar feature with serverOptions.link below. I was trying to achieve similar thing via ag-grid api. Can you please advise

https://api.adaptabletools.com/interfaces/_src_adaptableoptions_searchoptions_.searchoptions.html

Upvotes: 1

Views: 1594

Answers (2)

Jonny Wolfson
Jonny Wolfson

Reputation: 121

Update on this question as I developed AdapTable which the OP refers to in her question. We DO enable and facilitate server-side searching, sorting and filtering while keeping ag-Grid in ClientSideRowModel mode and many of users take huge advantage of it.

You can learn more at:

https://docs.adaptabletools.com/docs/key-topics/server-functionality

However note that this is suited to the use case where you have a few hundred thousand rows and want to have the best of both worlds; if you have millions of rows of data that needs searching and filtering then you should use ag-Grid's Server or Infinite Row Models (both of which AdapTable fully supports but in different ways to that mentioned in the OP).

Upvotes: 1

sandeep joshi
sandeep joshi

Reputation: 2151

Well Client-Side RowModel is the default. The grid will load all of the data into the grid in one go. The grid can then perform filtering, sorting, grouping, pivoting and aggregation all in memory.

The Server-Side Row Model builds on the Infinite Row Model. In addition to lazy-loading the data as the user scrolls down, it also allows lazy-loading of grouped data with server-side grouping and aggregation. Advanced users will use Server-Side Row Model to do ad-hoc slice and dice of data with server-side aggregations.

Ideally developer should choose either of them. Also AG Grid doesn't allow any method to set RowmodelType type programmatically.

So the simple answer is no it can't be done easily.

But I think you can do some workaround by creating another hidden AG Grid which will be created with RowmodelType = 'client side'. update the data in this 2nd grid whenever data changes in the first grid. also switch between grid(using hide show logic) when user wants to filter on client side(may be you can provide a radio button for that) and you can set filterstate/columnstate etc.. settings from 2nd to 1st grid.

Upvotes: 0

Related Questions