Announcement

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

    ListGrid: Can't select many records at once

    Hello,
    We are using SmartClient_80_Pro.

    We have grid that could hold thousands of rows. We use the pagination, but want to have the option to select all. Currently, the checkbox is disabled and the message "Can't select many records at once" comes up when click on the checkAll area.

    I saw thread: http://forums.smartclient.com/showthread.php?t=11630&highlight=%22select+records%22 which is similar to the issue that I have but for the Smart GWT environment.

    In the thread, you have suggested:
    "What does work and is already there is the grid.selectionProperty which allows you to maintain a server-side selection and convey it incrementally to the client."
    Will this suggestion work for the SmartClient_80_pro product that we are using? What are the grid.selectionProperty you are referening to? How to set the properties? could you provide some code sample?

    Thanks in advance!

    #2
    Yes, it will work, and the property is literally named as the post says: listGrid.selectionProperty.

    Comment


      #3
      Thank you for the information. Currently, the checkAll check box is not shown because there are too many rows and I'm using the pagination. How do I enable the checkAll Checkbox? Do I have to fetch all the rows first?

      I don't want to fetch all the rows (thousands of them) at once as I will get a javascript message when click on checkAll. The javascript error message says:Stop running this script? A script on this page is causing Intenet Explorer to run slowly. If it continues to run, your computer might be become unresponsive.

      Using the selectinProperty, when user click on a checkbox of a row, I assume there will be a request send to the server to set the value for the selectionProperty for the row selected/unselected. Is that right? what method will be called at the server side datasource? My row data structure is HashMap at the server side, how does client know how to set the value? Do I need to provide some setter and getter method for the row class?

      Comment


        #4
        No, this feature doesn't do these things automatically, it simply allows an initial selection to be conveyed to the client. You would have to add your own saving mechanism, and the built-in checkbox for selectAll cannot know whether it should show checked or not because the necessary data isn't loaded, so you should have your own, separate checkbox for showing whether all records are selected.

        Comment


          #5
          Thanks for the information. It is very helpful.

          Is there a way to iterate through all the fetched rows in a ListGrid?

          The reason I ask is that I'm keeping track of whether a row is selected at the server side. When user click checkAll, I will send a request to the server to set the "isSelected" selectionProperty to true for all the rows. At the client side, I also need to select all the rows. I cannot call the ListGrid.selectAllRows as it will complain too many records. I only need to select all the rows that are fetched to the grid.

          The ListGrid.getVisibleRows and the ListGrid.getDrawArea only give a portion of the fetched the rows. I want to get all the rows that are fetched to the ListGrid.

          Comment


            #6
            ResultSet.rowIsLoaded() and rangeIsLoaded() can be used to detect whether rows are loaded.

            Comment

            Working...
            X