Wednesday, April 25, 2012

Combotree in javascript (jquery)

I'm looking for a component which enable display tree in combo (select).
Something like that: http://www.jeasyui.com/demo/index.php



But this component doesn't allow import JSON directly, only from file.



It works in that way:



$('#cc').combotree({  
url:'tree_data.json'
});


I need (pseudocode):



$('#cc').combotree({  
data:'[{"id":1,"text":"City","children":[{"id":11,"text":"Wyoming","children":[{"id":111,"text":"Albin"}]}]}]'
});


Or (pseudocode):



$('#cc').combotree({  
data:'<?php $json_string; ?>'
});


Is it possible? Or maybe do you know any components which enable to do that?



Regards,
Chris





No comments:

Post a Comment