$.each (Content,function(I, item) {varINFO_TPL = "";varRESULT_TPL = "";varPre =/\<+\s* ([a-z]+) \s*/; INFO_TPL+ = "<div class= ' Result-info ' >" + "<p>" Execute sql: ("+i+") "</p>" + "<p>" +item.sql+ "</p>" + "<p>" +item.msg+ "</p>"; //Show Execution Results$ ("#pagebox. Pagebox-list:eq (" +index1+ "). Resultbox. Result-info-box"). Append (INFO_TPL); $("#pagebox. Pagebox-list:eq (" +index1+ "). Resultbox. Result-info-box"). Show (); if(Item.excute_result! = "&& item.excute_result! =undefined) { //Show result set columns varRESULTNAV_TPL = "<li><span class= ' resultnav-title ' title= '" +item.sql+ "> Result set" +x+ "</span></li > "; $("#pagebox. Pagebox-list:eq (" +index1+ "). Resultnav ul"). Append (RESULTNAV_TPL); RESULT_TPL+ = "<div class= ' result-content ' >" + "<table class=\" easyui-datagrid\ "style=\" width:10 0%;height: "+resultbox_height+" px;\ "data-options=\" striped:true,rownumbers:true,singleselect:true\ ">" + "<thead><tr>"; $.each (Item.excute_result,function(J, Vo) {if(j = = 0) {$.each (VO,function(h, v) {Result_tpl + = "<th data-options=\" field: ' + H + ', align: ' center ', width:80\ ' > ' +h+ ' </th> '; } ); RESULT_TPL+ = "</tr></thead><tbody>"; } RESULT_TPL+ = "<tr>"; $.each (VO,function(K, Val) {if(Pre.test (val)) {Result_tpl+ = "<td><xmp>" + val + "</xmp></td>"; } Else{RESULT_TPL+ = "<td title=" + val + ">" + val + "</td>"; } }); RESULT_TPL+ = "</tr>"; } ); RESULT_TPL+ = "</tbody></table></div>"; $("#pagebox. Pagebox-list:eq (" +index1+ "). Resultbox"). Append (RESULT_TPL); $.parser.parse ("#pagebox. Pagebox-list:eq (" +index1+ "). Resultbox"); The//jquery selector is the parent node of the parsing component x++; } } );
The jquery selector that needs to be explained must be a node above the parent of your parsing component. This means that the found node is equivalent to a container, which only parses the contents of the container.
JS Loop when generating multiple easyui DataGrid data grids, initialize table