PDA

View Full Version : tabpanel autoload question



davisty
18 Jan 2011, 10:59 AM
hello,

Newbie question ...

Is there a way to use the tabpanel autoload option to load a editorgrid into a tabpanel?

Im looking for a way to only load a jsonstore editorgrid when the tab is clicked.

Ive seen ways of using disabled buttons, but was a complete flyby.

18 Jan 2011, 12:23 PM
hello,

Newbie question ...

Is there a way to use the tabpanel autoload option to load a editorgrid into a tabpanel?

Im looking for a way to only load a jsonstore editorgrid when the tab is clicked.

Ive seen ways of using disabled buttons, but was a complete flyby.


Set an 'activate' handler on the grid. This will allow you to call the store's load method.

davisty
18 Jan 2011, 12:38 PM
Activate on the grid? Wouldnt this be on the tabpanel?

I hate to ask, but do you have and example? One using the store.

18 Jan 2011, 12:42 PM
Activate on the grid? Wouldnt this be on the tabpanel?

I hate to ask, but do you have and example? One using the store.



http://tdg-i.com/img/screencasts/2011-01-18_1541.png

The example depends on how exactly you configure your grid panel. There are thousands of references to setting up an event handler around this forum.

davisty
18 Jan 2011, 12:53 PM
Im sorry, Im new to certain concepts within extJS.

Im not trying to be a smart alect, but that may as well be written in Chinese. Localization should include expert and beginner.

18 Jan 2011, 1:18 PM
OK now you have me confused ;).


Do you still need an example of this activate handler or are you comfortable with doing it?

davisty
18 Jan 2011, 1:40 PM
I was only trying to joke that the documentation should include beginner and expert. When they start talking about child components and such, my twitch re-appears ...

If you could supply just a simple example, say an editor grid on a tabpanel, I will fiddle at your wedding ...

18 Jan 2011, 1:55 PM
:-\ i don't plan on getting married again.





var tabPanel = {

items : [
{
title : 'Panel 1',
html : 'HTML for panel 1'
},
{
xtype : 'grid',
store : {
xtype : 'jsonstore'
// your store here
},
listeners : {
activate : function(grid) {
grid.store.load({
url : 'some new url'
})
}
}
},
{
title : 'Panel 3',
html : 'HTML for panel 3'
}

]

}

davisty
18 Jan 2011, 2:07 PM
THANK YOU!!!!!, THANK YOU!!!!!, THANK YOU!!!!!

I hear ya, why buy the cow when the milk is free ...