欢迎您访问我爱IT技术网,今天小编为你分享的javascript教程:【在次封装easyui-Dialog插件实现代码】,下面是详细的讲解!
在次封装easyui-Dialog插件实现代码
$.fn.hDialog=function (options) {
var defaults={
width: 300,
height: 200,
title: '此处标题',
html: '',
iconCls: '',
submit: function () { alert('可执行代码.'); }
}
var id=$(this).attr('id');
options=$.extend(defaults, options);
var self=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');
}
}]
});
function createContent() {
$('.dialog-content',$(self)).empty().append('<div id="' + id + '_content" style="padding:5px;"></div>');
$('#' + id + "_content").html(options.html);
}
createContent();
}
关于在次封装easyui-Dialog插件实现代码的用户互动如下:
相关问题:怎么单独使用jquery easyui某个插件
答:直接引入jquery.js和所需组件src目录下jquery的相应插件就行了 直接用easyloader.js,直接用就可以,会自动判断引入相应插件 >>详细
相关问题:easyui写的后台 两个easyui-dialog冲突
答:用完之后要进行销毁。 $('#dlg').panel('destroy'); >>详细
相关问题:EasyUI中dialog的问题,懂的来,不懂别装懂!
答:function showAddDialog(){ //这里先empty一下 $('#brandAdd_dialog').empty() $('#brandAdd_dialog').dialog(); } >>详细
- 【firefox】firefox浏览器不支持innerText的解决
- 【Extjs】Extjs学习过程中新手容易碰到的低级错误
- 【clearInterval】js clearInterval()方法的定义
- 【ComboBox】ComboBox 和 DateField 在IE下消失的
- 【dom】javascript dom追加内容实现示例-追加内容
- 【checkbox】让checkbox不选中即将选中的checkbox
- 【Array】js中更短的 Array 类型转换-类型转换
- 【append】append和appendTo的区别以及appendChil
- 【ExtJs】ExtJs 表单提交登陆实现代码-表单提交-
- 【ajax清除浏览器缓存】Ajax清除浏览器js、css、
- 评论列表(网友评论仅供网友表达个人看法,并不表明本站同意其观点或证实其描述)
-
