jQWidgets Forums
jQuery UI Widgets › Forums › General Discussions › Editors › Input, Password Input, TextArea, ColorPicker, Rating, TagCloud, Loader › jqxInput select event misinterpreted
Tagged: javascript Input tag, jQuery Input
This topic contains 5 replies, has 4 voices, and was last updated by Peter Stoev 12 years, 1 month ago.
-
Author
-
Hello,
According to API documentation “select” event in jqxInput should be working when an item is selected from the auto-suggest popup. So if typed something which is not in the auto-suggest list this even should not be triggered, right? Unfortunately is I do that and then select it by mouse (clicking twice) it still treating the even like something that was selected from the auto-suggest list. Could you please advice on this behaviour? Basically I need to create a function do not accept in the input anything which is not in the “auto-suggest” list.
Thanks in advance
IgorHi Igor,
We confirm that behavior. The issue is that there is a default ‘select’ event which occurs when an Input tag is selected. As a workaround, you may bind to ‘focus’ and ‘blur’ events of the Input tag and update a boolean flag in the event handlers (isFocused = true) on focus and (isFocused = false) on blur. In the ‘select’ event handler, if isFocused == false, then the selection is done through the ‘mouse’.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Hi Peter
How to set ” isFocused = false” for jqx input . Please give me sample code for this.
Regards
Vijay babu.KHi,
isFocused is a custom boolean tag which I suggested in this post. You can set it by writing: isFocused = false or isFocused = true; To define such flag, write var isFocused;
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/this actually works great, but how to do assign to other jqxInputs parts of the object selected? My json returns formatted city+state, state, country. I can set the value of my jqxInput using the dataadapter using the code above via mouse select or keyboard, but how do I save the other elements from the object selected ?
Thanks
RobertHi,
jqxInput can display in the Popup only a field associated to the displayMember. Each item can have a “value”, too which is specified by the valueMember property. If you display additional things, then you can get the input’s displayed text using $(“#input”).val();
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.