PDA

View Full Version : tbtext inside toolbar having problem in IE



devkumar123
3 Sep 2012, 1:26 AM
Hi,

I have a toolbar, which has a tbtext and few buttons

this.fbar = {

xtype: 'toolbar',
id: 'tbtab',
items: [
{
xtype: 'tbfill',
id: 'tabFill'},

{xtype: 'tbtext',
text: '* blah blah blah blah blah',
id: 'infolbl',
hidden: true; },
{
xtype: 'button',
text: 'SAVE',
iconAlign: 'left',
disabled: false,
hidden: false,
id: 'btnSave',
},
{
xtype: 'button',
text: 'EDIT',
iconAlign: 'left',
disabled: true,
hidden: true,
id: 'btnedit',
ref: '../buttonedit'
},
{
xtype: 'button',
text: 'DELETE',
type: 'button',
disabled: true,
hidden: false,
iconCls: 'btn-delete',
iconAlign: 'right',
pressed: false,
repeat: false,
id: 'btndelete',
ref: '../buttondelete'
},
{
xtype: 'button',
text: 'CANCEL',
iconCls: 'btn-cancel',
iconAlign: 'right',
autoWidth: false,
autoHeight: false,
width: 120,
hidden: true,
disabled: true,
id: 'btnCancel',
ref: '../buttonCancel'
}
]
};

it works fine in Firefox, chrome but its throwing error in IE 8.x.

My code contains few more toolbar also, where each toolbar has only buttons. This is the only one toolbar which has tbtext also.  When I debug the code the error is  in ext-all.js.

if(e.events){Ext.applyIf(e.initialConfig,b);

if(e.events) its taking all other toolbar. but when the control reaches the above mentioned toolbar its throwing error "events' is null or not an object".

Can anyone tell me why its so and how can resolve it? Is it because of placing tbtext inside a toolbar?

Thanks in advance,
devkumar

sword-it
3 Sep 2012, 1:59 AM
Hi!



{xtype: 'tbtext',
text: '* blah blah blah blah blah',
id: 'infolbl',
hidden: true; },
{
xtype: 'button',
text: 'SAVE',
iconAlign: 'left',
disabled: false,
hidden: false,
id: 'btnSave',
},
....



Remove the ";" mark in hidden:true..

remove the ',' after id:'btnSave'

devkumar123
3 Sep 2012, 7:50 AM
Hi,

Thanks for your reply. I tried removing ; and , but still the same error. Is it something the toolbar doesn't support tbtext or the version is not compatible with VS2010.

Thanks,
DevKumar



Hi!



{xtype: 'tbtext',
text: '* blah blah blah blah blah',
id: 'infolbl',
hidden: true; },
{
xtype: 'button',
text: 'SAVE',
iconAlign: 'left',
disabled: false,
hidden: false,
id: 'btnSave',
},
....



Remove the ";" mark in hidden:true..

remove the ',' after id:'btnSave'

willigogs
3 Sep 2012, 8:12 AM
The most frequent cause for IE8 and below to error when other browsers render correctly is due to trailing commas at the end of an object (as SwordIT pointed out with your save button).

Check your other code for any additional instances of these, as it is highly likely this is the issue.

IE8 developer tools should really be able to point to the line where these exist, but alternatively you can run portions of your code through a JS validator:
http://www.jslint.com/