1. #1
    Sencha Premium Member
    Join Date
    Oct 2012
    Posts
    203
    Vote Rating
    0
    vkeswani can only hope to improve

      0  

    Default Unanswered: GXT Grid filtering by multiple values

    Unanswered: GXT Grid filtering by multiple values


    Hi,

    I have a GXT grid widget populated by store. I have also added couple of grid filters on some columns. However one of the requirement was to be able to filter by multiple values for example there is a set of codes as data and if I could filter by comma separated values?

    example code=5011,6099,3022 --> functioning more like the IN clause of SQL query? I do not see anything simple.
    Please suggest.

  2. #2
    Ext GWT Premium Member icfantv's Avatar
    Join Date
    Sep 2011
    Location
    Superior, CO
    Posts
    411
    Answers
    20
    Vote Rating
    21
    icfantv will become famous soon enough icfantv will become famous soon enough

      0  

    Default


    to my knowledge, there is not a filter in the existing API that does this.

    are you doing client-side or server side data manipulation (filtering, sorting, etc...)? depending on your answer, there are different ways to go about accomplishing this.

  3. #3
    Sencha Premium Member
    Join Date
    Oct 2012
    Posts
    203
    Vote Rating
    0
    vkeswani can only hope to improve

      0  

    Default


    I am doing ONLY client side filtering(setLocal(true)) - the simplest example as shown in gxt explorer.
    Another issue I am having is filtering on BigDecimal numeric filter in which case > and < filtering works but "=" doesn't. Are you aware of any issues with BigDecimal filtering?

    Thanks for the reply.

  4. #4
    Sencha Premium Member
    Join Date
    Oct 2012
    Posts
    203
    Vote Rating
    0
    vkeswani can only hope to improve

      0  

    Default


    Please let me know what different ways you are thinking of for accomplishing the first issue.

  5. #5
    Ext GWT Premium Member icfantv's Avatar
    Join Date
    Sep 2011
    Location
    Superior, CO
    Posts
    411
    Answers
    20
    Vote Rating
    21
    icfantv will become famous soon enough icfantv will become famous soon enough

      0  

    Default


    If you're having issues w/ filtering on BigDecimal I would encourage you to open a new thread as starting a new topic in an existing thread is generally frowned upon.

  6. #6
    Sencha Premium Member
    Join Date
    Oct 2012
    Posts
    203
    Vote Rating
    0
    vkeswani can only hope to improve

      0  

    Default


    OK I will do that. Could you please let me know what options I could consider for issue 1. Which is filtering with comma seperated values.

  7. #7
    Ext GWT Premium Member icfantv's Avatar
    Join Date
    Sep 2011
    Location
    Superior, CO
    Posts
    411
    Answers
    20
    Vote Rating
    21
    icfantv will become famous soon enough icfantv will become famous soon enough

      0  

    Default


    Let me start by saying we do all our filtering on the server-side so I don't know if any of this will work. The advantage of server-side filtering is that we let SQL do the filtering and are not restricted to the filtering language required by filtering on the client side (more on this below).

    The easiest thing to do would be to create your own filter by extending com.sencha.gxt.widget.core.client.grid.filters.Filter and adding it to GridFilters.

    You might want to start by looking at the built-in StringFilter because it's essentially a wildcard filter that looks for a user entered substring from the model field in question. There may be a way to adapt this for your use unless your fields are numeric. You'll see the filtering "language" used internally by the filter. I would assume that this is interpreted by some mechanism of the grid to decide whether or not a given model object is to be displayed.

    You're going to need to take the extra steps of providing a TextField (or whatever widget you deem appropriate) to let the user enter the comma-delimited list of values and then depending on the above, i.e., whether or not the client-side filtering "language" exists you may need to filter your values somewhat manually.

  8. #8
    Sencha Premium Member
    Join Date
    Oct 2012
    Posts
    203
    Vote Rating
    0
    vkeswani can only hope to improve

      0  

    Default


    Thank you! Yes we do have part of the application doing server side filtering without using the GridFilters provided bu GXT. I was hoping for more out of the box GXT filter(example as in filtergrid > < and = ) are available they would allow comman seperated values as well but looks like it doesn't exist out of the box.

  9. #9
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,731
    Answers
    109
    Vote Rating
    90
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    The GridFilters do not have this functionality. The Store itself does.

    Lets look at the case of wanting to only show cases where a double field equals 1, 0.5, or 11. A few reasons why this would get messy fast:
    * We can no longer use the existing NumberField class, with its parsing, validation, and limitations on which keys you need
    * In some locales, '.' is a decimal separator. In others, ',' may be used. How do you distinguish between the numbers in the string "1,0,5,11"?
    * Okay, so say GXT added a "+" button on the end of the number field (and every other field). And a config option to turn this off and on. And a new field, specially for this case (a Field<List<N extends Number>>). A big complaint already about the library is that there are so many widgets that perform so many tasks - what would this be named to be very clear about what it does, where it can be used, where it falls in the type hierarchy? Should it support spinner buttons, so that it has a up/down button as well as a plus button?

    Store lets you add arbitrarily many local filters to it - if any one filter says 'yes, this item should be visible', it will be visible. So you can still build this functionality, just not with the *provided* grid filters. Additionally, you can build your own grid filter classes, say a class like this:
    Code:
    public class NumericSetFilter<M, V extends Number> extends Filter<M, List<V>> {
      //...
    }

Thread Participants: 2

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi