ext.button这个js我引到jsp页面上了,在页面中<body onload="addTab();">,调用这个function,但是没有触发ext.button这个按钮的效果,
引入的js代码
Ext.onReady(function(){
var tabss = new Ext.TabPanel({
renderTo:'tabss',
resizetabss:true, // turn on tab resizing
minTabWidth: 115,
tabWidth:135,
enabletabsscroll:true,
height:700,
defaults: {autoScroll:true},
plugins: new Ext.ux.TabCloseMenu()
});
// tab generation code
var index = 0;
while(index < 1){
// alert(index);
addTab();
}
function addTab(){
tabss.add({
title: 'New Tab ' + (++index),
iconCls: 'tabss',
html: ''
+ Ext.example.bogusMarkup,
closable:true
}).show();
}
new Ext.Button({
text: 'Add Tab',
handler: addTab,
iconCls:'new-tab'
}).render(document.body, 'tabss');
});
之前这个方法在其他地方用<div id="tabss">调用过,但是现在需要调用的地方是纯ext的代码,全是javascript,不能有div,没分了,有高手愿意的话,我在此求教!不知道确切解决方法的我们一起讨论下。