2
votes

In a extjs app, I have a tree panel that is loading json data from a store. In that information I have a property checked that allows me manipulate a checkbox over a row in the tree panel. Currently I have two events that I use to do some actions (checkchange and select).

How can I do to set true the state of the checkbox by listening the select event?

Select Event

In this picture shows the select event over a row, I want to set true the state of the checkbox listening the select event.

1

1 Answers

3
votes

You can do it like this:

tree.on("select",function(me,rec,index){
    var node = me.getStore().getNodeById(rec.get('id'));
    node.set("checked", true);
});

Check out this working jsfiddle: https://jsfiddle.net/fxt0ep9b/1/