Feb 24, 2012, 11:26 AM
add multiple tab pages from Client side
Hi
i've wrote some code but it dosen't work properly.
regards
i've wrote some code but it dosen't work properly.
function onEditRow(tabPanel)
{
var selected = GridPanel1.getRowsValues({ selectedOnly : true});
for (i = 0; i < selected.length; i++)
{
var record = selected[i];
addTabPage_FromUrl(tabPanel, 'title - ' + record["pageID"], 'EditPage/KEdit.aspx?'+"ID="+record["pageID"]);
// alert(Ext.encode(record));
}
};
// add tab
var addTabPage_fromTreeNode = function (tabPanel, node) {
addTabPage(tabPanel, node.text, node.attributes.href);
}
var addTabPage_FromUrl = function (tabPanel, text, url)
{
addTabPage(tabPanel, text, url);
}
var addTabPage = function (tabPanel, text, url)
{
var tab = tabPanel.getItem(text);
if (!tab)
{
tab = tabPanel.add(
{
id : text,
title : text,
closable : true,
autoLoad : {
showMask : true,
url : url,
mode : "iframe",
maskMsg : "بارگذاری " + text + "..."
},
listeners : {
update : {
fn : function (tab, cfg) {
cfg.iframe.setHeight(cfg.iframe.getSize().height);
},
scope : this,
single : true
}
}
});
}
tabPanel.setActiveTab(tab);
}
when i iterate throgh the selected items, tabpages are added but actually the last one is loaded into it's tab and other tab pages are empty.regards
Last edited by Daniil; Feb 24, 2012 at 11:57 AM.
Reason: Please use [CODE] tags