PDA

View Full Version : calling a function from autoLoad attribute



pachaudhary
16 Aug 2008, 2:19 AM
Hello Sir,

I am a beginner in EXT JS.

I am trying to add a custom function to the autoLoad property of a Window, but it throws an error "uncaught exception: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIXMLHttpRequest.open]" nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)" location: "JS frame :: javascript: eval(__firebugTemp__); :: anonymous :: line 1" data: no]"

The code that I have written is

win = desktop.createWindow({
id: 'grid-win',
layout: 'fit',
autoLoad: createCenterRegion
})

function createCenterRegion(){
new TabPanel({.....})
}.

Can you help me out with this?

Regards
Pankaj.

evant
16 Aug 2008, 2:23 AM
You can't do that.

You need to use the items property of the window, not autoLoad.