jQuery UI Widgets Forums TreeGrid Number of rows

This topic contains 2 replies, has 2 voices, and was last updated by  Dimitar 9 years, 11 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Number of rows #60682

    MrBjorn
    Participant

    Does anyone know how to get the total number of rows in a treeGrid?

    I tried the grids method:

    var rowscount = $(“jqxGrid”).jqxGrid(‘getdatainformation’).rowscount;

    i.e.

    var rowscount = $(“jqxTreeGrid”).jqxTreeGrid(‘getdatainformation’).rowscount;

    but getdatainformation doesnt seems to be there.

    Number of rows #60683

    MrBjorn
    Participant

    i found one way, but i guess its some simpler way also.

    var rows = $(“#jqxTreeGrid”).jqxTreeGrid(‘getRows’);
    var noOfRows = 0;
    var traverseTree = function(rows)
    {
    for (var i = 0; i < rows.length; i++)
    {
    noOfRows += 1;
    if (rows[i].records)
    {
    traverseTree(rows[i].records);
    }
    }
    return noOfRows;
    };
    noOfRows = traverseTree(rows);

    Number of rows #60689

    Dimitar
    Participant

    Hello MrBjorn,

    This is the right way of getting the number of rows in a jqxTreeGrid.

    Best Regards,
    Dimitar

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

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

You must be logged in to reply to this topic.