PDA

View Full Version : passing params to panel constructed within Layout items?



Mic1
12 Jul 2012, 12:04 AM
How would I pass data to "grdProd2"? tia, Mic.


"xtype": "tabpanel",
"activeTab": 0,
"items": [
{
"xtype": "panel",
"layout": {
"type": "border"
},
"title": "Tab1",
"items": [
{
"autoScroll" : true,
"border" : false,
"flex" : 1,
"margins" : "0 0 5 0",
"region" : "north",
"xtype" : "grdProd2"
}, .......

k got it:

{
"autoScroll" : true,
"border" : false,
"flex" : 1,
"margins" : "0 0 5 0",
"region" : "north",
"xtype" : "grdProd2",
"testPassParam" : "pass_some_stuff"
}

with:
Ext.define('ExtMVC.view.GrdProd2', {
testPassParam : '' ....

tvanzoelen
12 Jul 2012, 12:16 AM
All the properties you set between the {} of your xtype will be put in the config object. The config is passed as input param to the constructo of for example your grdProd2



{
"autoScroll" : true, <-- is param
"border" : false, <-- is param
"flex" : 1, <-- is param
"margins" : "0 0 5 0", <-- is param
"region" : "north", < --- is param
"xtype" : "grdProd2"
}, .......