jQuery UI Widgets › Forums › Grid › Filter a grid by comparing 2 fields
This topic contains 4 replies, has 2 voices, and was last updated by jccompagnon 9 years, 1 month ago.
-
Author
-
I have a grid with 3 columns
A, B and C
I want to filter the grid by value in A Less than Value in Chow do I do that ?
If you bypass the built-in filtering system, you can achieve almost anything with the virtualmode=true setting and server-side queries. But virutalmode is extremely bug-ridden, and the jqwidgets team isn’t very responsive about fixing things (even when I send them actual code for bugfixes).
Check into the loadserverdata callback function, and maybe try googling for my handle along with “virtualmode” to save yourself some hassle.
You could also try gathering your data and then loading it into a grid that uses localdata. Basically just bypass all the built-in stuff and dumb it down for the widgets as best you can.
In other words, handle the filtering yourself separately, then display it with the grid.
Hi,
My grid is already in virtual mode.
but I am not sure how I can make a filter that would compare A and C
I get the back end if I send a special filter code that I can then recuperate and generate the data based on that special filter code but how do I have that custom filter sent to the back endIn the source for your data adapter, check into these two callback functions: formatdata and loadServerData
the first one allows you to manipulate the server parameters that returns what becomes the first argument to loadServerData. I suppose you could ignore that and just do everything in the loadServerData callback. You should be able to do what you’re after using that.
If you notice how frequently loadServerData is called, you might consider implementing a caching solution to improve performance. I did exactly that, and it worked great for performance and response times.
gotcha, I understand now I will give it a try. thank you
-
AuthorPosts
You must be logged in to reply to this topic.