在次封装easyui-Dialog插件实现代码
2023-06-13 09:14:25 时间
$.fn.hDialog=function(options){
vardefaults={
width:300,
height:200,
title:"此处标题",
html:"",
iconCls:"",
submit:function(){alert("可执行代码.");}
}
varid=$(this).attr("id");
options=$.extend(defaults,options);
varself=this;
$(self).dialog({
title:options.title,
height:options.height,
width:options.width,
iconCls:options.iconCls,
buttons:[{
text:"确定",
iconCls:"icon-ok",
handler:options.submit
},{
text:"取消",
iconCls:"icon-cancel",
handler:function(){
$("#"+id).dialog("close");
}
}]
});
functioncreateContent(){
$(".dialog-content",$(self)).empty().append("<divid=""+id+"_content"style="padding:5px;"></div>");
$("#"+id+"_content").html(options.html);
}
createContent();
}
调用:
$(function(){
vard=$("<divid="d"></div>");
$("#d").hDialog({submit:function(){$(d).dialog("close");}});
})
相关文章
- easyui(一) 初始easyui「建议收藏」
- jquery中失去焦点事件_easyui失去焦点事件没触发
- 技术汇总:第四章:使用Easyui做三级下拉列表
- EasyUI combobox 加载JSON数据详解编程语言
- EasyUI DataGrid及Pagination详解编程语言
- easyui datagrid自定义操作列详解编程语言
- jQuery easyui刷新当前tabs详解编程语言
- EasyUI tree扩展获取实心节点详解编程语言
- js控制easyui datagrid列的显示和隐藏详解编程语言
- EasyUI DataGrid实现单选且选择后可取消选择详解编程语言
- 简单使用EasyUI使MySQL更便捷(easyuimysql)
- Asp.net配合easyui实现返回json数据实例