Jump to content

UniComboBox - remote query with fixed list


jeans_larghi

Recommended Posts

version 0.99

UniComboBox  -remote query with fixed list

 
Hello Farshad ,   there is a way to prevent  bad input or errors?  For ex: DevExpress cxDBLookupCombobox can sets the DropDownListStyle to lsFixedList for avoid user input of casual value in combo editor..
 
Is this possible with uniComboBox with remote query? I want that ONLY correct values  can be typed; if i add some "not found" chars, edit value must revert to latest right value. 
 
Best regards.

 

 

  • Upvote 1
Link to comment
Share on other sites

  • 4 years later...

UniCombobox with remote query where you can only select items from list.

I'd like to get UniCombobox.itemindex working with remote query enabled. Not working for me now.

And also like to auto-revert user typed input when i exit UniCombobox if no item is selected.

So to summarise i'd like to have UniCombobox with csDropDownList itemindex behaviour but with option to search through it like on csDropDown+remote query.

Link to comment
Share on other sites

6 hours ago, rgreat said:

UniCombobox with remote query where you can only select items from list.

I'd like to get UniCombobox.itemindex working with remote query enabled. Not working for me now.

Hi,

Can you make a simple testcase for this?..

Link to comment
Share on other sites

  • 3 months later...
On 9/6/2019 at 7:25 AM, Sherzod said:

Hi,

Can you make a simple testcase for this?..

procedure TMainForm.UniComboBox1RemoteQuery(const QueryString: string; Result: TStrings);
var
  i: Integer;
begin
  Result.Clear;
  for i:=1 to 9 do begin
    Result.Add(i.ToString);
  end;
end;

1.

 image.png.0e0bd27fd1273572feb84de533bdd194.png

2.

image.png.ca673972a06f400e2ea404bca9f5c257.png

 

Even if you change UniCombobox.Style to csDropDownList nothing will change. 

ItemIndex will still be -1.

This make impossible to reliably select item in list unless you fallback to dirty tricks like adding ID in listbox item text.

 

test.zip

Link to comment
Share on other sites

Try ajaxRequest.

UniCombobox -> ClientEvents -> ExtEvents -> beforeselect :

function beforeselect(combo, record, index, eOpts)
{
  ajaxRequest(combo,'bselect',['index='+index]);
}

UniCombobox -> OnAjaxEvent :

procedure TMainForm.UniComboBoxAjaxEvent(Sender: TComponent;
  EventName: string; Params: TUniStrings);
begin
  if SameText(EventName,'bselect') then
  begin
    self.ShowToast(Params.Values['index']);
  end;
end;

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...