以下代码不显示模型窗口。为什么??但如果我使用$("#filterUserTaskWindow").jqxWindow('show');
而不是它会起作用$("#XUSER01 #filterUserTaskWindow").jqxWindow('show');
但我需要使用$("#XUSER01 #filterUserTaskWindow").jqxWindow('show');
<div id='XUSER01'>
</div>
<script>
//home tab bar
var UserHomeBar = '<table width="100%" height="35px" id="Homebar" cellpadding="0px" cellspacing="0px" border="0px"><tr bgcolor="#004A73">';
UserHomeBar = UserHomeBar + '<td>';
UserHomeBar = UserHomeBar + ' <input type="button" id="addnewtask" value="Add New Task" />';
UserHomeBar = UserHomeBar + ' <input type="button" id="filterUserTask" value="Filter" />';
UserHomeBar = UserHomeBar + '</td></tr></table>';
//home tab grid
UserHomeBar = UserHomeBar + '<div id="userTaskGrid" width="100%" ></div>';
//home tab filter window
UserHomeBar = UserHomeBar + '<div id="filterUserTaskWindow">';
UserHomeBar = UserHomeBar + '<div>';
UserHomeBar = UserHomeBar + '<table>';
UserHomeBar = UserHomeBar + '<tr>';
UserHomeBar = UserHomeBar + '<td><label id="lblfilterUserTaskDateFrom">From Date</label></td>' +
'<td> <div id="calfilterUserTaskFromDate"></div></td></tr>';
UserHomeBar = UserHomeBar + '<tr><td><label id="lblfilterUserTaskDateTo">To Date</label></td>' +
'<td> <div id="calfilterUserTaskToDate"></div></td></tr>';
UserHomeBar = UserHomeBar + '<tr><td> </td><td align="left"><input style="margin-right: 5px;" type="button" id="btnFilterUserTask" value="Filter" /></td>';
UserHomeBar = UserHomeBar + '</tr>';
UserHomeBar = UserHomeBar + '</table>';
UserHomeBar = UserHomeBar + '</div>';
UserHomeBar = UserHomeBar + '</div>';
UserHomeBar = UserHomeBar + '</div>';
$("#XUSER01").append(UserHomeBar);
$("#filterUserTaskWindow").jqxWindow({
width: 300,
height: 150,
autoOpen:false
});
$("#XUSER01 #filterUserTask").click(function() {
var xx=$("#XUSER01").find('*')
var flag=0;
for(i=0;i<xx.length;i++){
if(xx[i].id=='filterUserTaskWindow')
flag=1
}
if(flag==1)
alert('found');
else
alert('not found');
$("#XUSER01 #filterUserTaskWindow").jqxWindow('show');
});
</script>