Hi all!
I need a sort of messager.prompt, but using radiobuttons instead of textbox
So edited jquery.easyui.min.js and added:
.....
win.children("input.messager-input").focus();
return win;
},
//JAMC
/* msg is { val:text } collection for each radio button */
radio: function(title, msg, fn) {
var str="";
$.each(msg,function(val,text){
str +='<br /><input type="radio" name="messager-radio" value="'+val+'">'+text+'\n';
});
var content = '<div class="messager-icon messager-question"></div>'
+ '<div>' + title + '</div>'
+ '<br/>'
+ str
+ '<div style="clear:both;"/>';
var buttons = {};
buttons[$.messager.defaults.ok] = function(){
win.window('close');
if (fn){
var val=$('input:radio[name="messager-radio"]:checked').val();
fn(val);
return false;
}
};
buttons[$.messager.defaults.cancel] = function(){
win.window('close');
if (fn){
fn();
return false;
}
};
// _27f: createDialog()
var win= _27f(title,content,buttons);
return win;
},
//END JAMC
progress:function(_28e){
var _28f={bar:function(){
....
This patch works fine for me, but seems a bit dirty because needs patching (obfuscated) library file
My Question: ¿Whats the right way (tm) to extend $.messager to add different dialog styles without patching easyui library?
Thanks in advance
Juan Antonio