andyhill Posted August 7, 2020 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
Sherzod Posted August 7, 2020 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
andyhill Posted August 7, 2020 Author Posted August 7, 2020 It hides BOTH DropDown and Magnifier (or it did last time I checked). Quote
Sherzod Posted August 7, 2020 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
Sherzod Posted August 7, 2020 Posted August 7, 2020 4 minutes ago, andyhill said: What are the settings of the UniDBLookupComboBox you are using? Quote
andyhill Posted August 7, 2020 Author 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
Sherzod Posted August 7, 2020 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
david_navigator Posted August 7, 2020 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
andyhill Posted August 7, 2020 Author 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
Sherzod Posted August 7, 2020 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
david_navigator Posted August 7, 2020 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
Sherzod Posted August 7, 2020 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
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.