Jump to content

UniDBComboBox with csDropDownList


cristianotestai

Recommended Posts

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

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...