Jump to content

Recommended Posts

Posted

добрый день

подскажите можно как то отделить событие OnClick по иконке (выделил синим) и по названию (выделил красным)

сейчас событие OnClick реагирует как при нажатии на иконку так и при нажатии на текст элемента

image.png.435532fd21094793408b500dee4265fe.png

Posted

нужно отдельно при нажатии мышкой по иконке поменять ее, но при этом чтобы срабатывало событие OnClick

Posted
16 hours ago, AlexanderP said:

получится реализовать отдельное событие для иконки ?

Да,

Я проанализирую.

Posted
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;

 

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.

×
×
  • Create New...