Announcement

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

    Problem with LiveGrid

    Hi,

    I am facing a problem with LiveGrid. In my application, the data is being populated to livegrid from Servlet which supplies 50,000 rows of data, It is generally taking much time to load data for the first time. But when I am doing sorting on any column, it taking so much time that Internet Explorer is giving an alert saying: "Stop running the Script? A script on this page is causing Internet Explorer to run slowly. If it continues to run, your computer may become unresponsive."
    This is a serious performance issue as I have to submit the code sample to client. I have attached all the codes. Please suggest any possible way to stop this alert? I also want to know how will I implement cache memory utility so that everytime when i run the application, data can be loaded from the cache memory.

    Thanks
    Arindam
    Attached Files

    #2
    You shouldn't be loading all 50K records at once. The datasource passing parameters startrow, endrow as part of the request and your servlet should just be returning that segment of data

    Comment


      #3
      Can you provide any example, how to pass startrow, endrow parameter from datasource to callback, please?

      Comment


        #4
        In your datasource, override the transformRequest like follows

        Code:
            @Override
            protected Object transformRequest (DSRequest dsRequest)
            {
                if (dsRequest.getOperationType () == DSOperationType.FETCH)
                {
                    JSOHelper.setAttribute (data, "_endRow", dsRequest.getEndRow ());
                    JSOHelper.setAttribute (data, "_startRow", dsRequest
                            .getStartRow ());
                }
        
                return super.transformRequest(dsRequest);
            }
        and in the servlet backing the datasource, you can get these parameters and handle them to provide the iterated result.

        Code:
        ....
        String startRow = request.getParameter ("_startRow");
        String endRow = request.getParameter ("_endRow");
        ...
        ...
        // Handle the resultset to iterate from startRow to endRow.
        ....
        Hope it helps.

        Comment


          #5
          Thanks a lot for your help. It works.

          Comment


            #6
            Hi, Can you please share the code that worked. It would be really very helpful.

            Comment


              #7
              Also, looking at the code snippet fargo had written, how does the listgrid (livegrid) actually know that there are more rows to come. I mean, do I need to fire a fetch using a scrollhandler? Would it be possible to share a worked out example?

              Comment


                #8
                Can anyone pls share the code of the Live Grid with huge amount of data loaded.

                Thanks

                Comment


                  #9
                  Ok with 50K records.
                  But when i've only 2 records the listgrid don't filter when i use the native filter.
                  What's the problem?



                  Originally posted by fargo
                  In your datasource, override the transformRequest like follows

                  Code:
                      @Override
                      protected Object transformRequest (DSRequest dsRequest)
                      {
                          if (dsRequest.getOperationType () == DSOperationType.FETCH)
                          {
                              JSOHelper.setAttribute (data, "_endRow", dsRequest.getEndRow ());
                              JSOHelper.setAttribute (data, "_startRow", dsRequest
                                      .getStartRow ());
                          }
                  
                          return super.transformRequest(dsRequest);
                      }
                  and in the servlet backing the datasource, you can get these parameters and handle them to provide the iterated result.

                  Code:
                  ....
                  String startRow = request.getParameter ("_startRow");
                  String endRow = request.getParameter ("_endRow");
                  ...
                  ...
                  // Handle the resultset to iterate from startRow to endRow.
                  ....
                  Hope it helps.

                  Comment


                    #10
                    Hi Nikkali,

                    Check for setFilterOnKeypress(true) on the grid and setCanFilter(true) to the element/column on DS.

                    Comment


                      #11
                      Hi mdrafi,
                      this properties are set in true, but don't make filter.


                      Originally posted by mdrafi
                      Hi Nikkali,

                      Check for setFilterOnKeypress(true) on the grid and setCanFilter(true) to the element/column on DS.

                      Comment


                        #12
                        I've resolved.
                        I muss inserted the fetchdata method on listgrid and rewrite the DSCallback.



                        Originally posted by nikkali
                        Hi mdrafi,
                        this properties are set in true, but don't make filter.

                        Comment

                        Working...
                        X