In my project, I use easyui-layout, which has west and center region.
When i click easyui-linkbutton announcement, oat.php will return table content which will be included in cenDiv successfully.
Here is my js code:
function corpAnn()
{
var oaAnn="annIn";
$.ajax({
dataType:'html',
type:"POST",
url:"oat.php",
data: {oaAnn:oaAnn},
success:function(data)
{
$('#cenDiv').html(data);
}
});
}
Here is my html code:
<div id="firDiv" class="easyui-layout">
<div id="wesDiv" data-options="region:'west',split:true" >
</div>
<div id="cenDiv" class="easyui-layout" data-options="region:'center',title:''">
</div>
</div>
<a href="javascript:void(0)" class="easyui-linkbutton" onclick="corpAnn()">announcement</a><br />
Here is oat.php code:
echo '<div id="tbbs" class="easyui-panel" title="Panel Footer" style="width:100%;height:80%;border:1px solid #A9A9A9 ;" data-options="footer:\'#ft\'">';
echo '<table id="bbs" class="cenClass" border=1px cellspacing=0 align="center" width="100%">';
......
echo '</table>';
echo '</div>';
And then, I want to doubleclick table tr, which will call alert method.
But unfortunately, it worked fail. Here is my js test code:
$(document).ready(function()
{
$('#cenDiv').on("dblclick","#tbbs #bbs td",function(){
alert("thsTest");
});
});
I know when loading my main web page, tbbs and bbs id are not exit in DOM.So I should rebond them to cenDiv id.But I don't know how. Who can help me?