jQuery UI Widgets Forums Grid Error: jqxGrid: The data is still loading

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

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Error: jqxGrid: The data is still loading #49339

    asugama
    Participant

    Hi,

    I’m using jqxgrid on jqxwindow to show history logs of a record. The window will appear when user click on the record. The grid can only be populated once, subsequent binding failed with the following error “Error: jqxGrid: The data is still loading”. This problem has been bothering me for quite a while now, so if anyone can help to shed some lights on the possible mistakes will be greatly appreciated.

    
    function showHistoryLog(id)
    {
    	var url = "history.php";
    	var historySource =
        {
            datatype: "json",
            datafields: [
                { name: 'id' },
                { name: 'attribute' },
                { name: 'oldvalue'},
                { name: 'newvalue' },
                { name: 'date' },
                { name: 'user' }
            ],
    		type: 'POST',
    		data: {action:'listHistoryLog', reference: 'Company', referenceid: id},
            id: 'id',
            url: url,
            root: 'Rows',
    		beforeprocessing: function(data)
    		{		
    			historySource.totalrecords = data[0].TotalRows;
    		}
        };
        var historyDataAdapter = new $.jqx.dataAdapter(historySource);
        
        $("#jqxgrid_historylog").jqxGrid(
        {
        	width: '99%',
            autoheight: true,
            source: historyDataAdapter,
            columnsresize: true,
            enablehover: false,
            pageable: true,
            virtualmode: true,
            pagesize: 10,
            pagesizeoptions: ['10'],
            pagermode: "simple",
    		rendergridrows: function()
    		{
    			  return historyDataAdapter.records;     
    		},
            columns: [
              { text: 'Attribute', dataField: 'attribute', width: '20%' },
              { text: 'Old Value', dataField: 'oldvalue', width: '20%' },
              { text: 'New Value', dataField: 'newvalue', width: '20%' },
              { text: 'Updated Date', dataField: 'date', width: '25%' },
    		  { text: 'Updated By', dataField: 'user', width: '15%' }
            ]
        });
        
        $("#historylog").jqxWindow('open');
    }
    <a href="javascript:showHistoryLog(1);">Show History</a>
    
    Error: jqxGrid: The data is still loading #49505

    Dimitar
    Participant

    Hello asugama,

    Please try destroying the grid (with the method destroy) before initializing it again. After using destroy, append the grid div dynamically to the window’s content and then call the initialization code.

    If this approach fails, please provide us with a larger example and explain how to reproduce the issue step-by-step.

    Best Regards,
    Dimitar

    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.