jQWidgets Forums

jQuery UI Widgets Forums Grid rowCount in renderstatusbar problem

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by  Mariya 9 years, 5 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • rowCount in renderstatusbar problem #78654

    melvin
    Participant

    Hi, the renderstatusbar method isn’t work for me, please help !
    (if I un-mark the 2 line in renderstatusbar, Uncaught TypeError: Cannot read property ‘totalrecords’ of undefined )

    function loadrec(option,selectdate){
    // prepare the data
    var source =
    {
    url: ‘query.php?option=’+option+”&selectdate=”+selectdate,
    dataType: ‘json’,
    cache: false,
    datafields: [
    { name: ‘uuid’ },
    {…
    ],
    root: ‘Rows’,
    sort: function()
    {
    // update the grid and send a request to the server.
    $(“#jqxgrid”).jqxGrid(‘updatebounddata’, ‘sort’);
    },
    beforeprocessing: function (data) {
    source.totalrecords = data[0].TotalRows;
    }
    };
    var dataAdapter = new $.jqx.dataAdapter(source);
    var zeroRenderer = function (row, columnfield, value, defaulthtml, columnproperties) {
    if (value == 0) {
    return ‘ ‘;
    };
    };
    //var span = $(“<span id=’spanRowCount’></span>”);
    $(“#jqxgrid”).jqxGrid({
    source: source,
    theme: ‘classic’,
    sortable: ‘true’,
    //pageable: true,
    width: ‘810’,
    autoheight: ‘true’,
    virtualmode: true,
    altrows: true,
    showstatusbar: true,
    //pageable: true,
    rendergridrows: function(obj)
    {
    return obj.data;
    },
    renderstatusbar: function (statusbar) {
    //var rowCount = $(“#jqxgrid”).jqxGrid(‘getrows’).length;
    //statusbar.append(‘<div style=”margin: 5px;”>Rows count: <span id=”rowsCountSpan”>’ + rowCount’ + ‘</span></div>’);
    },
    columns: [
    { text: ‘UID’, datafield: ‘uuid’, width: 50, cellsalign: ‘left’, cellsformat: ‘n5’ },

    ]

    });
    /*
    $(“#jqxgrid”).on(“bindingcomplete”, function (event) {
    var rowCount = $(“#jqxgrid”).jqxGrid(‘getrows’).length;
    $(‘#rowsCountSpan’).text(rowCount);
    });
    */
    }

    rowCount in renderstatusbar problem #78672

    Mariya
    Participant

    Hi melvin,

    Can you please provide us with an example using https://www.jseditor.io/ in order for us to be more accurate?

    Best Wishes,
    Mariya

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.