AlexanderP Posted April 5, 2025 Posted April 5, 2025 добрый день подскажите можно как то отделить событие OnClick по иконке (выделил синим) и по названию (выделил красным) сейчас событие OnClick реагирует как при нажатии на иконку так и при нажатии на текст элемента Quote
Sherzod Posted April 5, 2025 Posted April 5, 2025 Добрый вечер, Почему возникла такая необходимость? Quote
AlexanderP Posted April 5, 2025 Author Posted April 5, 2025 нужно отдельно при нажатии мышкой по иконке поменять ее, но при этом чтобы срабатывало событие OnClick Quote
AlexanderP Posted April 5, 2025 Author Posted April 5, 2025 поправка, чтобы не срабатывало событие OnClick Quote
AlexanderP Posted April 6, 2025 Author Posted April 6, 2025 Sherzod получится реализовать отдельное событие для иконки ? Quote
Sherzod Posted April 7, 2025 Posted April 7, 2025 16 hours ago, AlexanderP said: получится реализовать отдельное событие для иконки ? Да, Я проанализирую. Quote
Sherzod Posted April 7, 2025 Posted April 7, 2025 17 hours ago, AlexanderP said: получится реализовать отдельное событие для иконки ? Решение: 1. UniTreeView1.ClientEvents.ExtEvents -> function itemclick(sender, record, item, index, e, eOpts) { if (e.getTarget('.x-tree-icon', 1)) { //var nodeId = record.id; //var nodeText = record.data.text; //console.log('Клик по иконке:', nodeText); Ext.defer(function() { //ajaxRequest(sender.ownerCt, 'iconClick', ['nodeId=' + nodeId]) ajaxRequest(sender.ownerCt, 'iconClick', []) }, 50); return false; } } 2. UniTreeView1 -> OnAjaxEvent procedure TMainForm.UniTreeView1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin if EventName = 'iconClick' then ShowMessage('SelectedNode.Text = ' + UniTreeView1.Selected.Text); 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.