jQuery UI Widgets Forums Grid Reset grid state

Tagged: ,

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

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • Reset grid state #59689

    supun151515
    Participant

    Hello Everyone,

    I am facing small issue with $("#jqxgrid").jqxGrid('loadstate', state);'

    1. I want to load saved state when grid initialize.
    2. When I click on Reset button, it should reset the grid to original style.

    I have tried to reset the grid using forum previous post

                   width: 660,
                    source: dataAdapter,
                    theme: theme,
                    groupable: true,
                    showfilterrow: true,
                    filterable: true,
                    autoheight: true,
                    altrows: true, //color every other row
                    pageable: true,
                    //pagermode: "simple",
                    columnsreorder: true,
                    columnsresize: true,
                    rendered: function () {
                         initialState = $("#jqxgrid").jqxGrid('getstate');
                        }
    
    $("#distroy").on('click',function(){
                    $("#jqxgrid").jqxGrid('loadstate', initialState);
                              });

    But it doesn’t work for me.
    Hope you understand my question.

    Thnak You,
    Supun Silva

    Reset grid state #59691

    Peter Stoev
    Keymaster

    Hi Supun,

    Saving the state in “rendered” function is wrong, becuase that function will be called when you call the “loadstate” too. You should probably use “ready” callback function instead.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Reset grid state #59696

    supun151515
    Participant

    Hi Peter,
    Thank you for your correct answer, it works perfect.
    I am still searching for load state at grid initialize.

    Thank You,
    Supun Silva

    Reset grid state #59700

    Peter Stoev
    Keymaster

    Hi Supun,

    If you want to load state on Grid initialize, you will need to do this in the “ready” callback function, too.

    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.