jQWidgets Forums

jQuery UI Widgets Forums Grid JQXGrid rendering in virtual mode with local data

This topic contains 2 replies, has 2 voices, and was last updated by  nadeem4n 10 years, 2 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author

  • nadeem4n
    Participant

    Hi,

    I am using JQXGrid with virtualmode and local data. I have set “totalrecords” property to the total number of records. The height of grid is fixed which is 100%. I am facing a few issues as below:

    1. I have, say, 30 records in total. As soon as I scroll to the bottom of the grid, all I see is the empty rows and all the records are hidden on top. If the data set is larger than 100, it works fine.
    2. I have 30 records, and I set totalrecords to 30. But “renderingrows” function is called initially with startIndex as 0 to endIndex as 100. Why is it 100 even when total records are less? How do I change or configure it? Probably this causes the empty rows at the end of the view.

    Please help.

    Thanks & regards,
    Nadeem Ullah


    Peter Stoev
    Keymaster

    Hi Nadeem Ullah,

    I suggest you to look at the Grid’s Data Binding demos which demonstrate how this feature works and should work. Then follow the same pattern.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/


    nadeem4n
    Participant

    Thanks Peter,

    After comparing with the sample, I fixed it as below in “renderingrows” function. The returned array needs to have the same indices as given in params parameter. Earlier, I was using “slice” method on my data array where resulting array always starts with a 0 index.

    renderingRowsFun: function(params){
       var range = {};
       for(var i = params.startindex; i <= params.endindex; i++){
          range[i] = yourData[i];
    }
    return range;
    }
Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.