You can access this function by referring to the copy that was saved when creating this instance of the widget, for example:
"Ok":function(){ $.data(this, "ImageLibrary")._somePrivateFunction.call(this); }
Here you can try here .
Another way, if this is an option, is to make it accessible via a bridge using a widget (if people override button arguments, this should be available in any case), for example:
$.widget("ui.ImageLibrary", $.ui.dialog, { options: { title:'Choose Image', buttons:{ "Ok":function(){ $(this).ImageLibrary("someFunction"); }, "Close":function(){ $(this).ImageLibrary("close"); } } }, someFunction: function(){ alert("test"); } });
Here you can try here . The difference is obviously not strictly confidential, but if someone else needs to change what this βokβ button does, you probably want it to be set anyway? Something to keep in mind overall, so just drop it there.
source share