OK, thanks very much for the clone tipp.
How can I extend the combobox plugin to get this refresh icon added by default to all the comboboxes including combobox-editors but EXCLUDING comboboxes in filter panel?
The idea is to have an event which will be called when reload icon is clicked. I have the event already defined:
$.fn.combobox.defaults = $.extend({}, $.fn.combobox.defaults, {
onReloadIconClicked: function(cb) {
$(cb).combobox('reload');
}
});
// currently I am inserting the icon manually with the handler as follows:
function _insertRefreshIcon(cb) {
var opts = cb.combobox('options');
if(cb.hasClass('combobox-f') && opts.addRefreshIcon == true) {
if(cb.parent().hasClass('datagrid-filter-c')) {
return; // don't add refresh icon for filter comboboxes!
}
if(opts.icons.length == 0 || (opts.icons[0] && opts.icons[0].iconCls != 'icon-reload')) {
var icons = $.extend([],opts.icons);
icons.unshift({
iconCls:'icon-reload',
handler: function(e){
opts.onReloadIconClicked.call(this, cb);
}
});
$(cb).combobox({icons:icons});
}
}
}