View Full Version : Card layout deferredRender: false not working

17 Mar 2011, 7:46 AM
I have a card layout as follows:

layout: 'card',
activeItem: 0,
deferredRender: false,
items: [{
id: 'empty-card' // first card is empty until use selects node
xtype: 'dbform', // custom form registered with type 'dbform'
items: [{
xtype: 'compositefield',
items: [{
xtype: 'checkbox',
name: 'check',
handler: function() {
var form = this.findParentByType('dbform').getForm();

when I set this form to the active item I first check the box, but it seems like my component doesn't really fully exists at this point as my call to findParentByType returns null.

Ext.getCmp('card-panel').getLayout().setActiveItem(1); // set item to dbform
// this causes my handler for my checkbox to be fired but seems like my form panel is not setup at this point
'check': true

This only bombs on the first call, i.e. like my component was not fully initialized so it could not find the parent by type. All other calls to the handler work just fine after the first call.

I thought that setting deferredRender: false would force all cards in my card layout to be rendered but just hidden.

Hopefully I explained my problem ok, any questions

17 Mar 2011, 5:19 PM
This seems to only be an issue with composite fields.

Though debugging I have discovered that my composite field has no ownerCt element. So when I try and find the parent of type 'form' for the checkbox it looks in the composite field does not find it and stop because there is no owerCt for the composite field.

Anyone now of a workaround?