Their work in the face of problems, just their own records, just part of the code, you may also encounter similar problems, although the expression is not very rigorous and thoughtful, similar problems can be referred to under.
function AddTab (subtitle, URL, icon, id) { //Add tab functions
if (!$ (' #tabs '). Tabs (' exists ', subtitle)) {
$ (' #tabs '). Tabs (' Add ', {
Title:subtitle,
Content:createframe (Id,url),//tab content parameter, with function return value, function definition below
Closable:true,
Icon:icon
});
} else {
$ (' #tabs '). Tabs (' select ', subtitle);
Refresh
$ (' #mm-tabupdate '). Click ();
}
Curtab = subtitle;
Tabclose ();
}
function createframe (ID, url) {
var s = ' <iframe id= ' + ID + ' "scrolling=" Auto "frameborder=" 0 " src= '
+ URL + ' "style=" width:100%;height:100%; " ></iframe> ';
return s;
}//the function stitching the string and returning it as a content value
First, the initial understanding of the content is a string format, to change the contents of the tab to change the function definition, the internal definition of the implementation of the target content into a string and then return it.
(later tested content can be a number value, normal display, object value does not show no error, array error)
Test function
function AA () {//Failure method
Added static HTML <div id= "AA" style= "><table style=" height:300px "class=" TT "in tab body structure ></table> </div> to create a DataGrid
$ ('. tt '). DataGrid (obj);
var s=$ ("#aa"). Get (0). InnerHTML;
return s;
The}//problem is that only the first click of the Tree menu takes effect because the static structure can only be used once, and the first click on the menu node can be used
The second click of the menu node does not have access to the
---------cause for the time being unknown
Second, change the idea of the first Html <div id= "AA" style= "" ><table style= "height:300px" class= " tt" ></table></div > Dynamically add to tab and then callback to create a DataGrid in an existing structure.
function bb () {
var s = ' <div id= ' AA "style=" "><table style=" height:300px " id=" tt "></table></div>";
Cannot use ID ID unique multiple tabs between IDs will conflict to class name just fine
var ss = ' <div id= ' AA "style=" "><table style=" height:300px " class=" tt "></table></div>";
return SS;
}
AddTab (Treenode.name, Treenode.action_url, "", treenode.id);
$ (". tt"). DataGrid (obj);//Add a sentence after adding a tab to create a DataGrid.
Addressed the content configuration issue.
Easyui Taps Plugin Add new tab parameters content configuration Issues