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 7 years, 9 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • Filter a grid by comparing 2 fields #91692

    jccompagnon
    Participant

    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 C

    how do I do that ?

    Filter a grid by comparing 2 fields #91725

    TP_DTNA
    Participant

    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.

    Filter a grid by comparing 2 fields #91728

    jccompagnon
    Participant

    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 end

    Filter a grid by comparing 2 fields #91755

    TP_DTNA
    Participant

    In 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.

    Filter a grid by comparing 2 fields #91758

    jccompagnon
    Participant

    gotcha, I understand now I will give it a try. thank you

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.