jQWidgets Forums

jQuery UI Widgets Forums Grid How do Jqxgrid Save the state of the grid?

This topic contains 3 replies, has 2 voices, and was last updated by  Peter Stoev 10 years, 4 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • How do Jqxgrid Save the state of the grid? #65909

    kuberasamrat
    Participant

    In our websites, we have jqxgrid(3.6) in most of the pages in our product. There are lot of grids so it is difficult to give unique names across the product. Some of the grids have same name.

    Problem Statement: grid1 has saved its state when a column is sorted. Load grid2(but of same id selector). It is sending the same sorting column as a parameter. As that column doesn’t belong this page, request fails and unable to get the data.

    Because of that, load state is giving the problem.

    Please let me know how to overcome that. I have pasted sample code below.

    var dataAdapter = new jQuery.jqx.dataAdapter(source);
    
        jQuery("#gridTable").jqxGrid({
    	pageable:true,
    	width:'100%',
    	autoheight:true,
    	sortable:true,
    	pagerheight:32,
    	pagesizeoptions:[10,20,30],
    	altrows:true,
    	virtualmode:true,
    	columnsresize:true,
    	theme:'ui-lfx',
    	columnsheight:52,
    	enablebrowserselection:true,
    	enablemousewheel:false,
    	showpinnedcolumnbackground:false,
    	columnsreorder:true,
    	selectionmode:"none",
    	autosavestate: true,
            editable:true,
            autorowheight:true,
            ready: function(){
       		$("#gridTable").jqxGrid('loadstate');
           		$("#gridTable").jqxGrid({source: dataAdapter});                                         
            },
            rendergridrows: function()
            {  return dataAdapter.records; },
            
            columns:[
                {text: "", datafield: "id",sortable:false, editable:false, pinned:true, resizable:false },
                {text: 'campaign_name', datafield: "camp_name", editable:false}
            ]    
        });
    How do Jqxgrid Save the state of the grid? #65912

    Peter Stoev
    Keymaster

    Hi kubera,

    jqxGrid usually saves state automatically on some user actions like sort, filter, page change. However, it may not be good for all tasks. that’s why there’s savestate method which allows you to save a state when you wish.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    How do Jqxgrid Save the state of the grid? #65917

    kuberasamrat
    Participant

    Peter,

    Even If we do manual savestate method, If we load state, the same problem arises when grid state is saved when one of the columns is sorted.

    How do Jqxgrid Save the state of the grid? #65921

    Peter Stoev
    Keymaster

    Hi kubera,

    If you load a state and change the source as you did then you will have a problem for sure, because your Grid will be in loading state when you change its source.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.