Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Checkboxes selection after Filter?

    I have a ListGrid with checkboxes :

    Code:
    setSelectionType(SelectionStyle.SIMPLE); setSelectionAppearance(SelectionAppearance.CHECKBOX);
    When a user checks some records, then filters the data for searching for other records, and then removes the filter, the previously checked records are being unchecked. Is there any simple way (built into SmartGWT) to overcome this?

    #2
    OK, I read in the forum that I have to implement the SelectionChangedHandler and save all the selected values.

    That is easy. But what happens in this case?:

    1) ListGrid is unfiltered.

    2) User selects 2 items -> these are saved externally using SelectionChangedHandler

    3) User filters ListGrid.

    4) User selects 3 items -> these are saved externally again

    5) User removes filter

    --> the 2 items selected before the filtering are not shown (as selected) in the ListGrid. So the user gets confused because he doesn't know that they are saved externally, so I would like to check them again for him. So that his view is consistent to what he already checked.

    What would be the best approach to do this?
    I thought of implementing FilterChangedHandler and somehow reselecting them.. but what can you recommend ?

    Comment


      #3
      Any ideas how to achieve this ?

      Comment


        #4
        Really no ideas? I don't think I am the first one with this problem?

        Comment


          #5
          edulid,

          You can write a addDataArrivedHandler to achieve this functionality. Since you already have the list of records selected by the user, you can check them when data arrives. The only disadvantage with this is your code iterates through the received records once for each data retrieval. I have successfully used this. Let me know if you have any concerns with this approach.

          Thanks.

          Comment


            #6
            Thank you very much, it works very well!

            Comment


              #7
              how you solved this problem? could show the code? Please...
              Last edited by Rauel; 22 May 2013, 09:59.

              Comment


                #8
                could you show the solution, Please :D

                Comment


                  #9
                  http://forums.smartclient.com/showthread.php?p=105029&posted=1#post105029

                  Comment

                  Working...
                  X