PDA

View Full Version : Unable to get value of the property 'heightModel': In IE 8 and under.



STi88
23 Nov 2012, 5:05 PM
There is a problem when rendering the layout of type hbox or vbox when I sandwich a panel with two grids (grid-panel-grid). This problem appears to only affect IE 8 and under.

So here's the problem...

I have a page with multiple hbox type layout containing grid-panel-grid items. When this is ran in IE 8 or under it will throw error: Unable to get value of the property 'heightModel': object is null or undefined.

I've trace down the code and notice the place that's triggering this error is from the beginLayoutCycle function where ownerContext.boxNames is undefined, therefore heightModel is also undefined.

What I don't quite understand is why would boxNames be undefined in this case, I notice that the ownerContext is the correct classtype, but I did notice something odd is that firstCycle was false when this error is triggered.

I couldn't get this to repeat in firefox or chrome, so I'm wondering if it is known bug for IE.

Extra context:
Looks like beginLayoutCycle was called from resetLayout function which does something to set beginLayout... but then everything was triggered from invlidate function which invalidates layout components.

So I'm trying to figure out and understand why the ownerContext object doesn't contain boxNames in this case for IE browsers.

If anyone have experience with this problem or idea to what might be causing this, it would be really helpful.

Thanks

mitchellsimoens
26 Nov 2012, 7:59 AM
What Ext JS 4.x.x version are you using? Can I get an example to reproduce?

STi88
26 Nov 2012, 10:58 AM
Currently we are using Ext JS version 4.1.3.

This is a sample of the code that we generate for grid-panel-grid item.



var AssignedStore = Ext.create('Ext.data.Store', {
model: 'LookupConfigRecord',
autoLoad: false,
proxy: Ext.create('Ext.data.proxy.Ajax', {
url: '/Data/AssignedValue/15',
reader: Ext.create('Ext.data.reader.Json', {
root: 'Data',
totalProperty: 'TotalSize'
})
})
});

// declare the source Grid
var TestDataAssignedGrid = Ext.create('Ext.grid.Panel', {
multiSelect: true,
id: 'TestDataAssignedGrid',
width: 300,
viewConfig: {
plugins: {
ptype: 'gridviewdragdrop',
dragGroup: 'TestData1AssignedGridGroup',
dropGroup: 'TestData1AvailableGridGroup'
},
listeners: {
beforedrop: function (node, data, dropRec, dropPosition) {
assignMask.show();
var IdArray=new Array();
for (i = 0; i < data.records.length; i++) {
IdArray[i]=data.records[i].get('ID');
}
}
}
},
store: TestData1AssignedStore,
columns: columns,
stripeRows: true,
title: 'Assigned',
margins: '0 5'
});

var AvailableStore = Ext.create('Ext.data.Store', {
model: 'LookupConfigRecord',
autoLoad: false,
proxy: Ext.create('Ext.data.proxy.Ajax', {
url: '/Data/AvailableValue/15',
reader: Ext.create('Ext.data.reader.Json', {
root: 'Data',
totalProperty: 'TotalSize'
})
})
});

// declare the source Grid
var TestData1AvailableGrid = Ext.create('Ext.grid.Panel', {
multiSelect: true,
id: 'TestData1AvailableGrid',
width: 300,
viewConfig: {
plugins: {
ptype: 'gridviewdragdrop',
dragGroup: 'TestData1AvailableGridGroup',
dropGroup: 'TestData1AssignedGridGroup'
},
listeners: {
beforedrop: function (node, data, dropRec, dropPosition) {
unassignMask.show();
var IdArray=new Array();
for (i = 0; i < data.records.length; i++) {
IdArray[i]=data.records[i].get('ID');
}
}
}
},
store: TestData1AvailableStore,
columns: columns,
stripeRows: true,
title: 'Available',
margins: '0 5'
});

var assignMask = new Ext.LoadMask(Ext.getBody(), {msg:"Assigning..."});
var unassignMask = new Ext.LoadMask(Ext.getBody(), {msg:"Un-Assigning..."});

var tabs = Ext.widget({
xtype: 'form',
id: 'tabForm',
layout: 'fit',
border: false,
bodyBorder: false,
items: {
xtype: 'tabpanel',
activeTab: 0,
defaults: {
layout: 'anchor'
},
items: [Ext.create('Ext.panel.Panel', {
title: 'Value Configuration',
layout: 'anchor',
items: [
Ext.create('Ext.panel.Panel', {
title: 'TestData',
layout: {
type: 'hbox',
align: 'stretch',
padding: 5
},
collapsible: true,
collapsed: true,
listeners: {
expand: function (p, eOpts) {
TestDataAssignedGrid.store.load();
TestData1AvailableGrid.store.load();
}
},
items: [TestData1AvailableGrid, Ext.create('Ext.panel.Panel', { html: '<div class="dd-controls"><a onclick="manualDragDrop(TestData1AvailableGrid, TestDataAssignedGrid, \'Assigned\', \'TestData\', \'15\', \'/Data/AssignValue\', \'/Data/UnassignValue\')" class="dd-fwd">fwd</a><a onclick="manualDragDrop(TestDataAssignedGrid, TestData1AvailableGrid, \'Unassigned\', \'TestData\', \'15\', \'/Data/UnassignValue\', \'/Data/UnassignValue\')" class="dd-back">back</a></div>', width: 100 }), TestDataAssignedGrid]
})]
})]
}
});




Typically there is more than one tab panel and each tab panel have multiple set of these grid-panel-grid objects.