Mar 08, 2012, 8:43 PM
[CLOSED] Adding panels to a tab panel throws exception
Adding panels to a tab panel throws exception. This is the main tab panels. panels are added to thid dynamically from JS code
<ext:TabPanel
ID="tpMain"
runat="server"
Region="Center"
Margins="0 0 4 0"
EnableTabScroll="true" TabWidth="10px" TabPosition="Top">
<Items>
<ext:Panel
ID="HomeTab"
layout="Fit"
runat="server"
Title="<%$ Resources:WebResources|Home.FormLabels, Home %>"
Icon="ApplicationForm"
Border="false" AutoScroll="true">
<Listeners>
</Listeners>
</ext:Panel>
</Items>
<ToolTips>
<ext:ToolTip runat="server" Delegate="#tpMain__HomeTab" Html="Home" />
</ToolTips>
<Listeners>
<TabChange Fn="History.addToken" />
</Listeners>
</ext:TabPanel>
AddPanel: function(config)
var id="thePanel"
Ext.Function.defer(function () {
tab = tp.addTab({
id: id.toString(),
title: title,
layout: "fit",
tabTip: config.title,
iconCls: config.icon || 'icon-arrowmerge',
closable: isClosable,
autoStroll: true,
listeners: {
},
loader: {
url: "/ProcessManagement/ProcessManagement/",
loadMask: false,
scripts: true,
autoLoad: true,
passParentSize: true,
params:
{
"tabId": id.toString()
}
}
});
}, 100);
}
public class ProcessManagementController : Controller
{
//
// GET: /ProcessManagement/ProcessManagement/
public ActionResult Index()
{
return View();
}
}
it is failling here where is the option passed to this function coming from. Do i need to config it in the javascrip above
load : function (options) {
options = Ext.apply({}, options);
if (this.paramsFn) {
this.params = this.paramsFn();
}
if (!Ext.isDefined(options.passParentSize) && this.passParentSize) {
options.params = options.params || {};
.>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> failing here<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
options.params.width = this.body.getWidth(true);
options.params.height = this.body.getHeight(true);
}
if (this.renderer == "frame") {
this.loadFrame(options);
return;
}
if (this.directMethod) {
var me = this,
mask = Ext.isDefined(options.loadMask) ? options.loadMask : me.loadMask,
params = Ext.apply({}, options.params),
callback = options.callback || me.callback,
scope = options.scope || me.scope || me;
Ext.applyIf(params, me.params);
Ext.apply(params, me.baseParams);
Ext.apply(options, {
scope : me,
params : params,
callback : me.onComplete
});
if (me.fireEvent('beforeload', me, options) === false) {
return;
}
if (mask) {
me.addMask(mask);
}
Ext.decode(this.directMethod)(Ext.encode(options.params),{
complete : function (success, result, response) {
me.onComplete(options, success, {responseText: result});
}
});
me.active = {
options : options,
mask : mask,
scope : scope,
callback : callback,
success : options.success || me.success,
failure : options.failure || me.failure,
renderer : options.renderer || me.renderer,
scripts : Ext.isDefined(options.scripts) ? options.scripts : me.scripts
};
me.setOptions(me.active, options);
return;
}
Ext.net.ComponentLoader.superclass.load.apply(this, arguments);
},
Last edited by Daniil; Mar 09, 2012 at 6:29 PM.
Reason: [CLOSED]