Nothing found in Kendo UI Combobox -
is there way notify user nothing found search query? in jira comboboxes. > http://i.stack.imgur.com/rksga.png
there nothing integrated, can build yourself.
see jsfiddle demo.
basically, what's happening is:
- return server. if there wasn't found, dummy entry special id.
- register select-event on combobox.
- in event, check see if selected item has special id, , if yes, cancel event e.preventdefault()
code:
$('input').kendocombobox({ datatextfield: 'text', datavaluefield: 'id', datasource: { transport: { read: function(options) { //instead, specify ajax call! options.success([{ id: -1, text: 'no matches...' }]); } } }, placeholder: "select...", select: function(e) { var dataitem = this.dataitem(e.item.index()); if(dataitem.id === -1) { e.preventdefault(); } } });
Comments
Post a Comment