0
如何根據Title
或some id
擴展或摺疊特定JPanels?展開/摺疊特定jpanels
到目前爲止,我可以切換使用按鈕展開/摺疊JPanels。
//Assigning a click event on button to trigger expand/collapse JPanel
$('#triggerPanelBtn').click(function(){
//alert($('.class').children('h3').attr("id"));
$('.class').children('h3').trigger('click');
});
var panels=""; //Creating JPanels on the fly
var trs='<tr width="100%">'+
'<th class="thPanel" align="left" width="40%">Database Type</th>'+
'<td align="left" width="60%" style="word-break:break-all;">Something</td>'+
'</tr>'+
'<tr width="100%">'+
'<th class="thPanel" align="left" width="40%">Database Version</th>'+
'<td align="left" width="60%" style="word-break:break-all;">Something</td>'+
'</tr>';
panels+='<div title="Database Version" class="class">'+
'<div class="jqUIDiv">'+
'<table class="jpanelTable">'+
'<tbody>'+trs+'</tbody>'+
'</table>'+
'</div>'+
'</div>';
panels+='<div title="ORS Databases" class="class" id="OrsDatabases">'+
'<div class="jqUIDiv">'+
'<table class="jpanelTable">'+
'<tbody>'+trs+'</tbody>'+
'</table>'+
'</div>'+
'</div>';
panels+='<div title="Master Database" class="class">'+
'<div class="jqUIDiv">'+
'<table class="jpanelTable">'+
'<tbody>'+trs+'</tbody>'+
'</table>'+
'</div>'+
'</div>';
$('#mainContent').empty();
$('<div>')
.html('<div>'+panels)
.appendTo('#mainContent').delay(10).queue(function(){
$('.class').jPanel({
'effect' : 'fade',
'speed' : 'slow',
'easing' : 'swing'
});
});
你可以這樣做:'this.title' –