This code has no problem.
$('#cc').combotree('textbox').css({backgroundColor: '#BAD7C9', color: '#515D57'});
You are right, if you create the combotree with an
id like this:
$('#cc').combotree({
url: 'get_data.php',
required: true
});
that code works, the problem is my combotree has no
id, because is create inside the datagrid filter:
$('#dg').datagrid('enableFilter',[
{
field:'users',
type:'combotree',
options:{
url:'get_users.php',
multiple:true,
checkbox:true,
onCheck:function(node,checked){
$('#dg').datagrid('addFilterRule', {
field: 'users',
op: 'equal',
value: node.text
}).datagrid('doFilter');
//Change the background color here
}
}
}
]);
I tried to change with:
$(this).parent().combotree('textbox').css({backgroundColor: '#BAD7C9', color: '#515D57'});
But in console throws error:
Uncaught TypeError: Cannot read property 'textbox' of undefinedSo the only way i can do this is with:
$('#dg').datagrid('getFilterComponent','users').combotree('textbox').css({backgroundColor: '#BAD7C9', color: '#515D57'});
But i don't know if is the best way.