x11 Posted June 25, 2020 Share Posted June 25, 2020 Можно ли как-то скрыть кнопку выбора? Если да, то как? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 25, 2020 Share Posted June 25, 2020 1 hour ago, x11 said: Можно ли как-то скрыть кнопку выбора? Если да, то как? procedure TMainmForm.UnimFormCreate(Sender: TObject); begin UnimDatePicker1.JSInterface.JSConfig('hideTrigger', [True]); end; 1 Quote Link to comment Share on other sites More sharing options...
x11 Posted April 27 Author Share Posted April 27 Подскажите, что тут не так? Почему кнопки триггеров видньі? HideTriggerTouch(edName, True);// edName: TUnimEdit; ... procedure HideTriggerTouch(FormControl: TUniFormControl; aReadOnly: Boolean = False); const constHideTrigger = 'hideTrigger'; begin //спрятать кнопку (триггер) выбора даты или кнопку выпадающего списка FormControl.JSInterface.JSConfig(constHideTrigger, [True]); // если компонента нередактируема, то и кнопка Очистить не нужна TExUniFormControl(FormControl).ClearButton := False; FormControl.ReadOnly := aReadOnly; end; Quote Link to comment Share on other sites More sharing options...
x11 Posted April 27 Author Share Posted April 27 Так тоже не работает: edName.JSInterface.JSConfig('hideTrigger', [True]); Можно ли скрьі сразу все триггерьі? Или только в цикле? edName.Triggers.Items[0].Visible := False; Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 27 Share Posted April 27 Добрый день! Контролы в режиме только для чтения? Quote Link to comment Share on other sites More sharing options...
x11 Posted April 27 Author Share Posted April 27 23 minutes ago, x11 said: FormControl.ReadOnly := aReadOnly; ну вот, как видите Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 28 Share Posted April 28 Попробую проанализировать. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 28 Share Posted April 28 On 4/27/2024 at 1:42 PM, x11 said: Почему кнопки триггеров видньі? Попробуйте это решение на данный момент: MainmForm.Script -> Ext.define(null, { override: 'Ext.field.Text', constructor: function(config) { this.callParent([config]); this.on('painted', this.onFieldPainted, this); }, onFieldPainted: function(field) { var triggers = field.getTriggers(); if (triggers && Ext.isObject(triggers)) { Ext.Object.each(triggers, function(key, value) { if (field.getReadOnly()) { value.hide(); } else { value.show(); } }); } }, updateReadOnly: function(readOnly) { var me = this; me.callParent(arguments); var triggers = me.getTriggers(); if (triggers && Ext.isObject(triggers)) { Ext.Object.each(triggers, function(key, value) { if (readOnly) { value.hide(); } else { value.show(); } }); } } }); 1 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.