andyhill Posted August 7, 2020 Share Posted August 7, 2020 I have a TUniDBLookupComboBox and I want to Hide DropDownTriggerButton (keep MagnifierLookUpTriggerButton) dblComboBoxSuppliers.ClientEvents.UniEvents.Clear; s:= 'beforeInit=function beforeInit(sender, config) '+ '{ '+ ' Triggers[0].hide(); '+ '} '; dblComboBoxSuppliers.ClientEvents.Add(s); Code above executes but does not hide button ? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 7, 2020 Share Posted August 7, 2020 34 minutes ago, andyhill said: I have a TUniDBLookupComboBox and I want to Hide DropDownTriggerButton (keep MagnifierLookUpTriggerButton) Hello Andy, UniDBLookupComboBox.HideTrigger property? Quote Link to comment Share on other sites More sharing options...
andyhill Posted August 7, 2020 Author Share Posted August 7, 2020 It hides BOTH DropDown and Magnifier (or it did last time I checked). Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 7, 2020 Share Posted August 7, 2020 5 minutes ago, andyhill said: It hides BOTH DropDown and Magnifier (or it did last time I checked). Are you adding custom triggers? Quote Link to comment Share on other sites More sharing options...
andyhill Posted August 7, 2020 Author Share Posted August 7, 2020 NO Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 7, 2020 Share Posted August 7, 2020 4 minutes ago, andyhill said: What are the settings of the UniDBLookupComboBox you are using? Quote Link to comment Share on other sites More sharing options...
andyhill Posted August 7, 2020 Author Share Posted August 7, 2020 //dblComboBoxSuppliers.HideTrigger:= True; *** HIDES ALL BUTTONS *** dblComboBoxSuppliers.ListSource:= UniMainModule.dsSuppliersLkUp; dblComboBoxSuppliers.GridMode:= lgmPostListValue; // lgmPostListValue, lgmPostKeyValue dblComboBoxSuppliers.ListOnlyMode:= lmFollowSource; // lmNoFollow, lmFollowSource (uniDBLookupHelper.pas) dblComboBoxSuppliers.ListField:= 'BusinessName'; dblComboBoxSuppliers.KeyField:= 'BusinessName'; dblComboBoxSuppliers.EndUpdate; UniMainModule.tblSuppliersLkUp.ReadOnly:= True; UniMainModule.tblSuppliersLkUp.Open; Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 7, 2020 Share Posted August 7, 2020 56 minutes ago, andyhill said: //dblComboBoxSuppliers.HideTrigger:= True; *** HIDES ALL BUTTONS *** 2 hours ago, Sherzod said: Are you adding custom triggers? Quote Link to comment Share on other sites More sharing options...
david_navigator Posted August 7, 2020 Share Posted August 7, 2020 This works for me (actually I do it at design time, just used Gexperts to copy component to source hence the With....) with UniDBLookupComboBox1.Triggers.Add do begin ButtonId := 0; IconCls := 'x-form-search-trigger'; end; Quote Link to comment Share on other sites More sharing options...
andyhill Posted August 7, 2020 Author Share Posted August 7, 2020 Thanks David but the buttons are already there, I wanted to remove one. I could of course remove all and then add but it is clearly a bug. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 7, 2020 Share Posted August 7, 2020 21 minutes ago, andyhill said: but the buttons are already there, I wanted to remove one. I could of course remove all and then add but it is clearly a bug. Andy, Sorry, seems I don't understand your case. Can you make a simple app to check? Quote Link to comment Share on other sites More sharing options...
david_navigator Posted August 7, 2020 Share Posted August 7, 2020 Do you mean that you have them displayed to the user but in some set of circumstances you want to change from two to one button at run time ? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 7, 2020 Share Posted August 7, 2020 2 hours ago, andyhill said: I wanted... Maybe you wanted this: procedure TMainForm.UniButton1Click(Sender: TObject); begin UniDBLookupComboBox1.JSInterface.JSCall('getTriggers().t1.setVisible', [False]); //t1, t2, t3, ... end; Quote Link to comment Share on other sites More sharing options...
andyhill Posted August 7, 2020 Author Share Posted August 7, 2020 Perfect - Thank You Quote Link to comment Share on other sites More sharing options...
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.