The 'icons' is an array not a function. To create the 'icons' dynamically based on the class value, please override the $.fn.textbox.parseOptions function.
(function($){
var parser = $.fn.textbox.parseOptions;
$.fn.textbox.parseOptions = function(target){
var opts = parser.call(this, target);
if ($(target).hasClass('qbe')){
opts.icons = [{
iconCls: 'icon-search',
handler: function(e){
$(e.data.target).textbox('setValue', 'Something added!');
}
}]
}
return opts;
}
})(jQuery);