function ValidateField(){
var bAllow= true;
//some checking here
if (bAllow == true && apl.val().trim() == "")
{
showDialog();
showDialog().done(function() {
return true; // wanna return true, but not success
}).fail(function() {
return false; //wanna return false, but not success
});
return false; //stop it to execute to next line
}
return bAllow; //success return }
function showDialog(){
var def = $.Deferred();
var modPop = '<div id="diaCom" title="Information?"><p>something something</p></div>';
$("#diaCom").remove();
$(modPop).appendTo('body');
$("#diaCom").dialog({
resizable: false,
draggable: false,
height:150,
width:300,
modal: true,
buttons: …
Run Code Online (Sandbox Code Playgroud) 我想取消选择(删除所选元素).我在我的演示中使用jstree.所以我读了插件api. http://www.jstree.com/api/#/?f=deselect_all([supress_event]).但它不会删除所选项目.我按照以下步骤操作:1)单击"b"节点,然后选择"b"节点.2)然后按"取消选择"按钮,但不取消选择项目.
$('#deselect').click(function(){
alert('--')
$('#tree').deselect_all(true)
})
Run Code Online (Sandbox Code Playgroud)