PDA

View Full Version : [2.0a1][CLOSED] pagingToolbar.add<anything> fails



jay@moduscreate.com
3 Oct 2007, 2:16 PM
I don't see anything wrong. maybe i've been doing this too much today? heh.

i get the following msg:
this.tr has no properties
[Break on this error] Ext.Toolbar=function(A){if(A instanceof Array){A={buttons:A}}Ext.Toolbar.supercl...



paging = new Ext.PagingToolbar({
store: ds,
pageSize: dsLimit,
displayInfo: true,
autoWidth: true,
displayMsg: 'Displaying events {0} - {1} of {2}',
emptyMsg: "No events to display"
});

pagingCombo = new Ext.form.ComboBox({
store: new Ext.data.SimpleStore ({
fields: ['num'],
data : [ [ 5 ], [ 10 ], [ 20 ], [ 50 ], [ 100 ], [ 200 ], [ 500 ], [ 1000 ] ]
}),
displayField:'num',
typeAhead: false,
mode: 'local',
triggerAction: 'all',
emptyText:'# Rows',
selectOnFocus:true,
allowBlank: false,
width: 65,
listWidth: 65,
vtype: 'port',
resizable:false
});
pagingCombo.on('select', function () {
setGridLimit(record.data.num);
});

//paging.addSeparator();
paging.addField(pagingCombo); //<-- or paging.add

jack.slocum
4 Oct 2007, 1:41 AM
You can't do an add() call with a toolbar until it has been rendered. This is a known limitation.

You can however pass the items you want right into the config (items), and it will manage adding them for you when it is ready.

jay@moduscreate.com
4 Oct 2007, 2:44 AM
perhaps we could throw the items into an array until the item is rendered, just like the logic for config parameters?

jack.slocum
4 Oct 2007, 3:14 AM
Yes, however unlike other classes which can do that easily, Toolbar has too many functions.

You could do it though if you pass an empty array items config in.

toolbar.items.push( instead of toolbar.add(

But even better solution would be to create the toolbar after you create the combo and then just pass it in with the items config.

jay@moduscreate.com
4 Oct 2007, 4:45 AM
Awesome. Thank you.