PDA

View Full Version : [4.1.0PR] Error when resizing window with toolbar overflow: bodyContext is undefined



zombeerose
9 Nov 2011, 10:38 AM
REQUIRED INFORMATION

Ext version tested:

Ext 4.1 rev 0
Browser versions tested against:

FF7 (firebug 1.8 installed)
DOCTYPE tested against:

Strict
Description:

The example includes a toolbar with a combobox field. If the field is initially rendered to the overflow menu, then resizing the window horizontally will trigger the error. If the field is initially visible, then resizing the window horizontally to a width that forces the field into the overflow menu will trigger the error.
Steps to reproduce the problem:

Run the code.
Attempt to resize the width of the window.
The result that was expected:

No error.
The result that occurs instead:

Error: bodyContext is undefined
/ext/src/layout/component/field/Field.js
Line 88
Test Case:



Ext.define('Ext.ux.toolbar.PageSize',{
alias: 'plugin.pagesize',
extend: 'Ext.AbstractPlugin',
requires: ['Ext.form.field.ComboBox'],

init: function(tb){
tb.on('beforerender', function(){
tb.add(
'-',
{ text: 'Before', xtype:'tbtext'}, //overflowText: 'Before',
{
allowBlank: false,
displayField: 'value',
editable: true,
forceSelection: false,
queryMode: 'local',
maskRe: /[0-9]/,
maxLength: 3,
store: Ext.create('Ext.data.ArrayStore',{
data: [[25],[50]],
fields: ['value']
}),
value: 25,
valueField: 'value',
width: 50,
xtype: 'combo'
},
{ text: 'After', xtype:'tbtext'} //overflowText: 'After',
);
});

this.callParent(arguments);
}
});

Ext.require(['Ext.toolbar.Paging']);

Ext.onReady(function(){
Ext.create('Ext.window.Window',{
dockedItems: [{
displayInfo: true,
dock: 'bottom',
enableOverflow: true,
plugins: [{
ptype: 'pagesize'
}],
xtype: 'pagingtoolbar'
}],
html: 'Example of bodyContext undefined',
width: 275,
height: 100

}).show();
});


HELPFUL INFORMATION

Possible fix:

not provided
Additional CSS used:

only default ext-all.css
Operating System:

WinXP Pro

mitchellsimoens
10 Nov 2011, 5:24 AM
When using Ext.create, you shouldn't specify the requires property like that, you should use Ext.require()

zombeerose
10 Nov 2011, 7:53 AM
@mitchellsimoens

I updated the code example. Their is still a bug.


When using Ext.create, you shouldn't specify the requires property like that, you should use Ext.require()