196
rated 0 times
[
197]
[
1]
/ answers: 1 / hits: 15227
/ 12 Years ago, wed, august 8, 2012, 12:00:00
I have been searching the interent for an age and couldnt find an answer. I was trying to change node text colour dependant on the type of the particular node. So in this example i wanted to change the text colour of every node that is a Role type defined in data.
$(#roleTree).jstree({
json_data: {
data: roleTreeData
},
themes: {
theme: default,
dots: true,
icons: false
},
ui: {
select_limit: 1,
select_multiple_modifier: none
},
types: {
types: {
AM: {
hover_node: false,
select_node: false
},
AF: {
hover_node: false,
select_node: false
},
Role: {
// i dont know if possible to be done here? add class?
// this.css(color, red)
//{ font-weight:bold}
}
}
},
plugins: [themes, json_data, ui, Select, types, crrm]
}).bind(loaded.jstree, function (event, data)
{
$(#roleTree).jstree(open_all);
data.inst.select_node('ul > li:first');
}).bind(select_node.jstree, function (event, data)
{
selectedRoleId = data.rslt.obj.attr(id);
window.selectedRole = GetRole(selectedRoleId);
});
}
Or any other method to highlight or tell users that only the role is selectable.
More From » jquery