Jump to content

dblookupcombobox


jahlxx

Recommended Posts

Ok.

 

I have a workaround, but there are 2 things I don't know how to do:

 

- I need only drop down when press a defined key, not when press the down arrow key

 

- And drop down when click on the arrow button

 

- And when I type something and match one row, the content of the lookoup doesn`t updates, I need to select the row in the drop down window.

 

THanks.

Link to comment
Share on other sites

OK.

 

Forget all of the above, I've got it.

 

2 more things:

 

- when the table data of the listsource of the combobox is updated, that data is nor refreshed in the combo the next time it is dropped-down. I'm forgetting something.

 

- is possible to open the listsource dataset on-demand?

 

thanks.

Link to comment
Share on other sites

Hi,

 

Other question about dblookupcombobox.

 

Is possible define onclick event for the fieldlabel?

 

Try this:

 

For example UniDBLookupComboBox1 -> ClientEvents->ExtEvents -> fn boxready:

function boxready(sender, width, height, eOpts)
{
    var labelEl = sender.labelEl;
    if (labelEl) {
        labelEl.setStyle('cursor', 'pointer');
        labelEl.on('click', function(e) {
            // your logic, js fn or AjaxRequest(sender, ...)
            ajaxRequest(sender, '_labelClick', []);
            e.stopEvent(); // if you want to prevent "default" handler
        })
    }
}
procedure TMainForm.UniDBLookupComboBox1AjaxEvent(Sender: TComponent;
  EventName: string; Params: TUniStrings);
begin
  if EventName = '_labelClick' then
    ShowMessage('labelClick');
end;
Link to comment
Share on other sites

I see one problem, and can reproduce in the samples.

 

In the case of anymatch=true, when you direct input a valid key value, the combo don't refresh and don't take any value.

 

you can test with the sample. type 1221, and press <tab>.

 

the combo don't refresh and 1221 is a valid value.

 

why?

 

thanks.

Link to comment
Share on other sites

yes, that is what I mean.

 

I don't agree this behaviour is correct. If 1221 is a valid value, the key value should be updated. Id the user knows the code and directly type it, is necessary to select a row of the combo? This could be time lost.

Link to comment
Share on other sites

Then, can you try this for now ?!:

 

UniDBLookupComboBox -> ClientEvents -> ExtEvents -> blur fn:

function blur(sender, e, eOpts)
{
    var me=sender;
    var picker=me.getPicker();
    var store=me.getStore();
    
    if (!me.value && picker && store.count()>0) {
        picker.select(0);
        me.setValue(picker.getSelectionModel().getSelection()[0].data.val);
        me.fireEvent("select");
    }
}
Link to comment
Share on other sites

ok.

 

and what about this?

 

- when the table data of the listsource of the combobox is updated, that data is nor refreshed in the combo the next time it is dropped-down. I'm forgetting something.

 

- is possible to open the listsource dataset on-demand?

 

thanks.

Link to comment
Share on other sites

  • 4 years later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...