jQWidgets Forums

jQuery UI Widgets Forums Grid Dynamically changing properties

This topic contains 2 replies, has 2 voices, and was last updated by  Black Moon 13 years ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Dynamically changing properties #3349

    Black Moon
    Member

    Hi all!

    Is it possible to dynamicall change jqwidget properties (f.e. grid control) during applicayion execution.

    Puprose – User click link (or button)

    and grid changes width, height, columns, data binding and etc.


    $('#leftmenu').bind('itemclick', function(event){
    switch ($(event.args).text())
    {
    case '1':
    $("#rolesgrid").jqxGrid('columns', columns1);
    $("#rolesgrid").jqxGrid('source', dataAdapter1);

    break;

    case '2':
    $("#rolesgrid").jqxGrid('columns', columns2);
    $("#rolesgrid").jqxGrid('source', dataAdapter2);
    break;
    }
    });

    Dynamically changing properties #3356

    Peter Stoev
    Keymaster

    It’s currently possible to change dynamically the data source, see here: jquery-grid-datasources.htm. Changing the columns after the Grid is initialized, requires the following in this version:

    $("#rolesgrid").jqxGrid('_columns', null);
    $("#rolesgrid").jqxGrid('columns', columns2);

    The above is a work-around for completely changing the columns array. However, if you want to change only column properties, such as text, width, datafield, you can use the appropriate methods such as ‘setcolumntext’, ‘setcolumnalign’, etc.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Dynamically changing properties #3371

    Black Moon
    Member

    Thanks – it works!!!

    There’s no need to create custom grids in each tab.

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

You must be logged in to reply to this topic.