In MVC 4, I am using jstree. In the create operation, I have no problem. But in the editing operation, I set the value truefor some treemodel elements. models are similar to:
public class RecursiveObject
{
public string data { get; set; }
public Int64 id { get; set; }
public FlatTreeAttribute attr { get; set; }
public List<RecursiveObject> children { get; set; }
}
public class FlatTreeAttribute
{
public string id;
public bool selected;
}
When I populate the tree model, I set selected = true;for some elements and use this in the view:
json_data: {
"ajax": {
url: "@Url.Action("GetTreeData", "MyController")",
type: "POST",
dataType: "json",
contentType: "application/json charset=utf-8"
}
},
However, all items are not marked. I see that the tags <li>have selected = "selected", but this does not affect the validation.
When I check the item manually , jstree-uncheckedit goes into the class jstree-checked. This means that selected = "selected"does not work.

How can I solve this problem?