Code:
$.extend($.fn.searchbox.methods, {
showError: function(jq, text) {
return jq.each(function() {
var textbox = $(this).searchbox('textbox');
textbox
.addClass('textbox-invalid')
.tooltip({
content: text,
position: "right",
deltaX: 24
})
.tooltip('show')
.tooltip('tip').css({
color: "#000",
borderColor: "#CC9933",
backgroundColor: "#FFFFCC"
});
});
}
});
And to call it just use
Code:
$('#search').searchbox('showError','Not found');
Where the searchbox is defined with the 'search' ID:
Code:
<input id="search" class="easyui-searchbox" style="width:300px"
data-options="prompt:'Please Input Value'">