cristianotestai Posted February 13, 2015 Posted February 13, 2015 Hello, In UniDBCombobox when the style option is set to csDropDown, typing in the combo, is automatically shown the options that start the informed characters. How to perform this same behavior when it is set to csDropDownList? I need to have the same function, but without allowing the user to change the contents of the ComboBox, so inform csDropDownList. This is a common feature in web applications. Any idea or workaround for this? Cristiano Quote
Sherzod Posted February 13, 2015 Posted February 13, 2015 Hi, The approximate implementation, try: 1. UniCombobox1 -> ClientEvents -> UniEvents function beforeInit(sender, config) { uniVars._filterValue = ""; } 2. UniCombobox1 -> ClientEvents -> ExtEvents function keypress(sender, e, eOpts) { uniVars._filterValue += String.fromCharCode(e.charCode || e.keyCode); setTimeout('uniVars._filterValue = ""', 500); if (sender.store.findRecord("val",uniVars._filterValue)) { sender.setValue(sender.store.findRecord("val",uniVars._filterValue).data.val) } else { sender.setValue(""); } } Best regards. Quote
cristianotestai Posted February 13, 2015 Author Posted February 13, 2015 Hi Delphi Developer! Work in general, but has a issue, it does not work correctly when the combobox is open, showing all options. In this situation, when entering the first letter, is set correctly for the text in the combobox, but pressing enter, the old index is selected. Thank you if you can see this issue. Best regards, Cristiano Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.