jQWidgets Forums

jQuery UI Widgets Forums Lists ComboBox select item which it just added

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 11 years, 4 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • select item which it just added #48444

    medman1
    Participant

    Hello, i am new here, i am searching how to add and select item from multi select in the same time. I tried it with this function, but it dosen’t work.
    So please I need your help !

     $('#jqxComboBox').on('keypress', function (event) {
    				   if ( event.which == 13 ) {
    						var i = $("#jqxComboBox").jqxComboBox('val');
    						if(i.length > 0) {
    						$("#jqxComboBox").jqxComboBox('addItem',''+i+''); 
    						}
    						
    					   var items = $("#jqxComboBox").jqxComboBox('getItems'); 
    					   var item = $("#jqxComboBox").jqxComboBox('getItem', items.length-1);   // last item added
    					  
    				
    					   $("#jqxComboBox").jqxComboBox('selectItem',item.label); 
    				   }
    			   });

    thanks for your reply

    select item which it just added #48477

    Peter Stoev
    Keymaster

    Hi medman1,

    That is unfortunately not possible. The keyboard is handled by jqxComboBox and while you type it tries to find a matching List Item. At present, the Multiple Selection mode works only with items which are already loaded into the ComboBox or added dynamically, but not while you type into the field. That would interfere with the widget’s built-in behavior.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.