jQWidgets Forums

jQuery UI Widgets Forums Grid Remembering column sizes

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 12 years, 10 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Remembering column sizes #4962

    Hi all,

    I have enabled column resizing on the jqxGrid and i would like to be able to remember how the user chose to resize the columns when reloading the page that has the grid on it.

    I’m guessing I’d have to save the settings somehow, I am wondering if you’d have some examples or best practises.

    Regards

    Remembering column sizes #4975

    Peter Stoev
    Keymaster

    Hi sammydeveille,

    We don’t have save/load functionality built-in jqxGrid, but it is possible to get the column sizes, save them somewhere via ajax or cookie, and load them when you load your application. The code below demonstrates how to get the width of a specific column and then how to set it to a new value.

    // get the width of a column.
    var companyNameColumnWidth = $("#groupeGrid").jqxGrid('getcolumnproperty', 'CompanyName', 'width');
    // set the width of a column.
    $("#groupeGrid").jqxGrid('setcolumnproperty', 'CompanyName', 'width', 150);

    Hope this helps you.

    Best Wishes,
    Peter Stoev

    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.