Hidden columns visible after reloading tab

2 posts, 0 answers
  1. klac
    klac avatar
    8 posts
    Member since:
    May 2013

    Posted 23 Jun Link to this post

    I have a TreeList inside a RadMultiPage and using a RadTabStrip to select the pages. When the tab is first selected the TreeList loads as expected. But after clicking the tab a second time, the TreeList shows the hidden columns. I believe that it may be related to the view state not being passed to the server on post back. Ideally, i would like the OnNeedDataSource event to fire again to rebuild the TreeList but I'd still like to maintain the view state as well.

    I've attached the source files as images.

     

    Thanks

  2. klac
    klac avatar
    8 posts
    Member since:
    May 2013

    Posted 28 Jun Link to this post

    I've figured out the problem and some possible solutions. It appears that hiding columns on the server side is not fully supported. There is information stored on the client for hidden columns but this information is not initialized from the server information. Options for resolving this issue include:

    1) after the tree list is created, toggle all hidden columns to be displayed, then back to being hidden:

    var columns = _treeList.get_columns();
    for (var i = 0; i < columns.length; ++i)
    {
        var column = columns[i];
        if (column.get_display()) continue;
        column.show();
        column.hide();
    }

    *Note that doing this from the OnTreeListCreated event requires calling the function from a window.setTimeout as the tree list hasn't fully initialized yet.

     

    2) after the tree list is created, update the internal list of hidden columns:

    var columns = _treeList.get_columns();
    for (var i = 0; i < columns.length; ++i)
    {
        var column = columns[i];
        if (column.get_display()) continue;
        _treeList._displayColumns[column.get_uniqueName()] = false;
    }
    _treeList.updateClientState();

    *Note that this is much faster than option 1 but has a risk of breaking in a future release.

     

Back to Top