PDA

View Full Version : [Solved] Is there something that gets triggered from win.show()?



Elijah
14 Jun 2010, 10:13 AM
I have a pre-defined tab-panel configuration [preBuilt].
This "preBuilt" item uses some datastores [datastores1, datastores2, datastores3].

The panel configuration is fetched from a parent js file and added to a "win = new Ext.Window({items[preBuilt]}).

Is there a way that I can have my preBuilt detect that its parent (whos name cannot be hard set), is renedered after the win.show() has been called?

I want the preBuilt once the win.show() has been called and the preBuilt display is called to make its calls to the datastores.load() method.

I do not want the parental js file that invokes the win.show() to have to know that the child has stores in it. Therefore calling down from the parent.js file to the preBuilt.js is not acceptible.

Suggestions?

16 Jun 2010, 6:04 PM
Why not setup the child items's 'show' event to load the store? That's what I do.

Animal
16 Jun 2010, 9:03 PM
@Elijah: Yes. Window has a show event. As you know.

Elijah
17 Jun 2010, 6:24 AM
Thank you for the direction, but I am getting the following issue when the event show is triggered.
Note the grid panel has an event to open a new window when the user selects a row.

When the panel is displayed the show event triggers the call to the url to obtaint the data. [this is fine]
but
If I select an item in the gridpanel, navigate to a different tab panel and then navigate back to the panel, the show event triggers again [thats fine], but in addition to the show event, the call that was made last by clicking on an item in the gridpanel fires thus opening up a new window for the item as if it had been selected.

Any ideas?



Panel{
items:[
gridPanel
],
listeners:[
show: function(){
gridPanel.getStore().load();
}
]
}

Animal
17 Jun 2010, 6:29 AM
I thought you wanted Window's show? That's what your thread title indicates.

Elijah
17 Jun 2010, 7:27 AM
I thought you wanted Window's show? That's what your thread title indicates.

I wanted to know the event that triggered from calling win.show() which thanks to you guys directed me to the API event show.
But stemming from that step I need to have the child (gridpanel) load it's datastore. Which I can do but the side effect issue mentioned above I do not understand why it is occuring.

So, I am hoping that someone can point me in the direction once again.

Animal
17 Jun 2010, 7:40 AM
I wanted to know the event that triggered from calling win.show() which thanks to you guys directed me to the API event show.


And you promptly added the listener to some spurious WRAPPER Panel which you have placed your GridPanel inside for some unknown reason.



But stemming from that step I need to have the child (gridpanel) load it's datastore. Which I can do but the side effect issue mentioned above I do not understand why it is occuring.

So, I am hoping that someone can point me in the direction once again.

The Window's show event. That is what you asked for (but didn't use)