sistasi
8 Jun 2008, 11:50 PM
hi,
i saw this (http://extjs.com/forum/showthread.php?t=24067) for calling function from link, i have my link within grid ready to call a function outside ext.onready.
However within this function i need to hide the panel that i created within ext.onready.
Does anyone know how to access or call the ext component within ext.onready from the function outside ext.onready?
Ext.onReady(function(){
Ext.QuickTips.init();
function formatRoleName(value, p, record){
var str ='';
if (record.data.desc != ''){
str += value + '<br/><i>' + record.data.desc + '</i>';
}else{
str += value;
}
if (record.data.hideAssignDA == true){
str += ' <a href="javascript:doHideAssignDA(' + "'" + record.data.name + "'" + ')"><img src="' + iconpath + 'application_view_tile.png" border="0"/></a>'
}
return str;
}
var roleCM = new Ext.grid.ColumnModel([
roleChkCol,
{id:'name', header: "Role Name", width: 222, sortable: true, dataIndex: 'name', renderer: formatRoleName},
{header: "Application", width: 80, sortable: true, dataIndex: 'app'},
{header: "Type", width: 80, sortable: true, dataIndex: 'type'},
{header: "Source", width: 80, sortable: true, dataIndex: 'env'},
{header: "Description", width: 80, sortable: true, dataIndex: 'desc', hidden:true},
//roleExpander,
roleRowActions
]);
var roleGrid = new Ext.grid.GridPanel({
id:'roleGrid',
autoHeight: true,
store: roleStore,
cm: roleCM,
bbar: rolePgtb,
plugins: [roleChkCol, roleExpander, roleRowActions]
});
var daPanel = new Ext.Panel({
id:'da-panel',
frame:true,
...
});
}); //end of Ext.OnReady
function doHideAssignDA(Name){
if(daPanel.isVisible() == false){
Ext.getCmp('daText').body.update('<p style="margin:10px">Hi <b>' +
Name + '</b></p>');
daPanel.show();
} else{
daPanel.hide();
}
}
this will give error: daPanel is not defined, i think because daPanel is within Ext.OnReady and when I used Ext.getCmp('daPanel') will still give error:
Ext.getCmp("daPanel") has no properties
any idea how to do this??
i saw this (http://extjs.com/forum/showthread.php?t=24067) for calling function from link, i have my link within grid ready to call a function outside ext.onready.
However within this function i need to hide the panel that i created within ext.onready.
Does anyone know how to access or call the ext component within ext.onready from the function outside ext.onready?
Ext.onReady(function(){
Ext.QuickTips.init();
function formatRoleName(value, p, record){
var str ='';
if (record.data.desc != ''){
str += value + '<br/><i>' + record.data.desc + '</i>';
}else{
str += value;
}
if (record.data.hideAssignDA == true){
str += ' <a href="javascript:doHideAssignDA(' + "'" + record.data.name + "'" + ')"><img src="' + iconpath + 'application_view_tile.png" border="0"/></a>'
}
return str;
}
var roleCM = new Ext.grid.ColumnModel([
roleChkCol,
{id:'name', header: "Role Name", width: 222, sortable: true, dataIndex: 'name', renderer: formatRoleName},
{header: "Application", width: 80, sortable: true, dataIndex: 'app'},
{header: "Type", width: 80, sortable: true, dataIndex: 'type'},
{header: "Source", width: 80, sortable: true, dataIndex: 'env'},
{header: "Description", width: 80, sortable: true, dataIndex: 'desc', hidden:true},
//roleExpander,
roleRowActions
]);
var roleGrid = new Ext.grid.GridPanel({
id:'roleGrid',
autoHeight: true,
store: roleStore,
cm: roleCM,
bbar: rolePgtb,
plugins: [roleChkCol, roleExpander, roleRowActions]
});
var daPanel = new Ext.Panel({
id:'da-panel',
frame:true,
...
});
}); //end of Ext.OnReady
function doHideAssignDA(Name){
if(daPanel.isVisible() == false){
Ext.getCmp('daText').body.update('<p style="margin:10px">Hi <b>' +
Name + '</b></p>');
daPanel.show();
} else{
daPanel.hide();
}
}
this will give error: daPanel is not defined, i think because daPanel is within Ext.OnReady and when I used Ext.getCmp('daPanel') will still give error:
Ext.getCmp("daPanel") has no properties
any idea how to do this??