[CLOSED] Gridpanel selected items in cardlayout

  1. #1

    [CLOSED] Gridpanel selected items in cardlayout

    Hi,
    I have a Gridpanel in a cardlayout with checkboxselectionmodel.

    When i change selected items in a directevent and do an updateSelection() the hasSelection() always returns false unless i activate the gridpanel in the cardlayout.

    This was working fine without activating the Gridpanel in the cardlayout but after updating from SVN it does not work anymore.

    I have tried deferredrender = false in the cardlayout layoutconfig.

    It is like the gridpanel won't update the selection until the panel has been activated at least once.

    Any help appreciated.

    Thanks
    Fergus
    Last edited by Daniil; Jan 28, 2014 at 5:22 AM. Reason: [CLOSED]
  2. #2
    Hi @Fergus,

    The background is the following.

    No items are available for selection until a GridView's ViewReady event fires.
    http://docs.sencha.com/extjs/4.2.1/#...vent-viewready

    The ViewReady event fires on rendering and layouting of the GridPanel. Yes, DeferredRender="false" helps to render the GridPanel in a hidden card immediately, but it doesn't force layouting. I think layouting can be properly done on first activation only. So, no layout => no ViewReady event => no selection. It is why the hasSelection method returns false.

    You said that it worked previously. I would say it was rather a defect.

    As a solution I can suggest the following:
    var hasSelectionExtended = function(sm) {
        if (sm.view.viewReady) {
            return sm.hasSelection();
        } else {
            return !Ext.isEmpty(sm.selectedData);
        }
    };
    hasSelectionExtended(App.RowSelectionModel1)

Similar Threads

  1. [CLOSED] GridPanel Selected Items Limit
    By ptrourke in forum 2.x Legacy Premium Help
    Replies: 10
    Last Post: Oct 17, 2013, 9:31 PM
  2. Recover values in selected items GridPanel
    By Dominik in forum 1.x Help
    Replies: 2
    Last Post: Jun 22, 2010, 8:19 AM
  3. Replies: 0
    Last Post: Feb 01, 2010, 12:42 PM
  4. Replies: 0
    Last Post: Jun 03, 2009, 5:30 PM
  5. [CLOSED] CardLayout rendering ALL panel contents at once AND OUTSIDE the CardLayout?
    By juanpablo.belli@huddle.com.ar in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Feb 26, 2009, 3:08 PM

Posting Permissions