Announcement

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

    Loading Problem in List Grid with One record in the Datasource.

    Hi,
    When i load data to listgrid using datasource which is having only one record, Data is not loading to grid. Getting the message like Loading data.. But it is not loading. when I am having more than one record in the Datasorce data is loading into grid.


    (I have a datasource. Data is added to it using RPC.
    After that i am setting that datasorce to my grid.)

    #2
    Hi chinjurani
    i am also facing the same issue,
    i dont know where i am doing the mistake. did you get any solution?

    Comment


      #3
      I had the same problem. To fix it for datasets that had only one row I added a blank row and it seemed to solve the problem

      Comment


        #4
        Guys,

        I just changed my code from
        Code:
         listGrid.setAutoFetchData(true);
        
        to
        
         listGrid.fetchData();
        it is working perfect.I also tested for 1 to 15 rows and result is good.

        please post me if you got any issues by using this solution

        -Hari

        Comment


          #5
          There shouldn't be a difference between fetching data via autoFetchData() vs an explicit call to fetchData()

          If you'd like to post a standalone test case we can use to reproduce the issue we can take a look and see if there's an actual bug here

          Comment


            #6
            Smart-GWT 2.4

            Happening to me in the latest release version. My ListGrids use setAutoFetchData(true).
            If a ListGrid has exactly one record it will not remove the loading data message and icon and draw the one row.

            This is my workaround:
            Code:
            		// workaround when one and only one row is fetched.
            		addDataArrivedHandler(new DataArrivedHandler() {
            			public void onDataArrived(DataArrivedEvent event) {
            				markForRedraw();
            			}
            		});

            Comment


              #7
              ohmi - definitely not a general problem. Closely inspect your response when there's one row to discover the actual problem, most likely an off-by-one in your startRow/endRow/totalRows numbers.

              Comment


                #8
                Thanks -- I am reviewing, but I do not use any of that kind of capability and never look at the number of rows myself -- it's all rows all the time. So if it's an off-by-one error, it's not in my code.

                Comment


                  #9
                  If you say so :) Let us know if you can produce a standalone, runnable test case demonstrating an issue with single-row results.

                  Comment

                  Working...
                  X