This is a migrated thread and some comments may be shown as answers.
Custom Button on TreeList - no action
1 Answer 79 Views
This is a migrated thread and some comments may be shown as answers.
Andy
Top achievements
Rank 1
Andy asked on 07 Jul 2015, 11:02 PM
I'm trying to add a custom button on a TreeList Toolbar.   I can see that .Toolbar (t=>t.Custom().Text("My Action")) is exactly what I'm looking for, however what is not obvious is how to add the action.   For the Grid, it would be .Toolbar(t=>t.Custom().Action("Action", "Controller").Text("My Action").   Why does TreeList have similiar behaviour?

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimiter Madjarov
Telerik team
answered on 08 Jul 2015, 10:57 AM

Hello Andy,

Currently specifying an Action for the TreeList custom commands is not supported. You could attach a click handler by it's data-command attribute.
E.g.

.Toolbar(t => t.Custom().Name("mycommand"))

$(function () {
    $("[data-command='mycommand']").click(function () {
        // custom logic
    });
});

Regards,
Dimiter Madjarov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Asked by
Andy
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Share this question
or