Jump to content

UniComboBox - remote query with fixed list


jeans_larghi
 Share

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

  • 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

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.

 Share

×
×
  • Create New...