jQuery UI Widgets Forums Grid virtual mode with few rows

This topic contains 7 replies, has 2 voices, and was last updated by  Alexey 4 years, 1 month ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
  • virtual mode with few rows #81085

    Alexey
    Participant

    Hi, I have modified your example with a grid in a virtual mode.
    http://jsfiddle.net/p8hn3azf/

    I have changed only few lines:

    var source = {
         datatype: "array",
         localdata: {},
         <strong>totalrecords: 5</strong>
     };
     // load virtual data.
     var rendergridrows = function (params) {
         var data = generatedata(params.startindex,<strong> 5</strong>);
         return data;
     }

    After that I got table with 5 rows with data and many empty rows. How to get rid of empty rows? I have read forum. Everyone says that populating rows excatly how in examples helped them. But how? This is not working for me.

    virtual mode with few rows #81099

    Dimitar
    Participant

    Hi Alexey Sharifullin,

    This is the normal behaviour of jqxGrid in this situation and it cannot be altered. The same question has already been answered in the following forum topics, too: Virtual scrolling mode and empty rows and Empty rows in virtualmode when totalrecords smaller than count of visible rows.

    Best Regards,
    Dimitar

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

    virtual mode with few rows #81103

    Alexey
    Participant

    Ok. I think it would be very helpful if you include description of that limitation to virtual mode in documentation. Such as you have to use virtual mode in use cases where returned data from server more than visible view. Otherwise blank rows will be displayed in empty visible space and there is no workaround about that.

    Thanks for quick reply.

    virtual mode with few rows #81106

    Dimitar
    Participant

    Hi Alexey Sharifullin,

    Thank you for your suggestions. We will try to improve our documentation. Please note that, while empty rows appear in this case, the virtual mode functionality can be used without any issues.

    Best Regards,
    Dimitar

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

    virtual mode with few rows #81110

    Alexey
    Participant

    I found a workaround for my use case. In my case I know exactly how many rows would be maximum at time of creating jqxgrid. So if maximum of rows is more than acceptable to query I am using virtual mode in another case setting virtual mode to false and populating localdata in source.

    if(totalrecords <= 100){
         source.localdata = rendergridrows({startindex:0, endindex:totalrecords});
     }

    http://jsfiddle.net/b4bjtequ/

    But in my example one issue still persists. When I click toggle button to change mode from normal to virtual a virtical scrollbar is not changing respectivly. But after some scrolling it became normal (with respect of collection size). Is any way to recalculate vertical scrollbar?

    virtual mode with few rows #81135

    Alexey
    Participant

    Anyone is there?

    virtual mode with few rows #81148

    Dimitar
    Participant

    Hi Alexey Sharifullin,

    Please add a call updatebounddata to your solution:

    $("#jqxbutton").jqxToggleButton({
      width: 250,
      height: 30
    }).on("click", function() {
      var toggled = $("#jqxbutton").jqxToggleButton('toggled');
      if (!toggled) {
        changeMode(1000000);
        $("#jqxgrid").jqxGrid('updatebounddata');
      } else {
        changeMode(5);
      }
    });

    Best Regards,
    Dimitar

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

    virtual mode with few rows #81175

    Alexey
    Participant

    This is awesome!

    Full working example is there http://jsfiddle.net/ppg0f7j2/

    Thanks a lot!

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.