1、jsp页面定义dialog及Buttons;
2、js文件方法;
<div id="win" style="padding: 5px" modal=true draggable=false class="easyui-dialog" closed=true
data-options="
buttons:[{
text:'save',
},{
text:'close',
}]">
2、js文件方法;
//buttons text取值!
$.extend($.fn.dialog.methods, {
bindButtonEvents: function (jq, param) {
return jq.each(function () {
var dialog = $(this);
dialog.parent().on('click', '.dialog-button a', function (e) {
var text = $(this).linkbutton('options').text;
var method = param[text];
if (method) { method(); }
});
});
}
});
//dialog按钮方法
$('#win').dialog('bindButtonEvents', {
save: function () {
console.log('hellolllllll')
},
close: function () {
console.log('close..............')
}
});