Hi,
How can i get JsonTree selected item properties ?
For example in your JsonTree Demo how can I selected tree items “value” or “text”
var data = [
{ “id”: “2”,
“parentid”: “1”,
“text”: “Hot Chocolate”,
“value”: “$2.3”
},
…]
var source =
{
datatype: “json”,
datafields: [
{ name: ‘id’ },
{ name: ‘parentid’ },
{ name: ‘text’ },
{ name: ‘value’ }
],
id: ‘id’,
localdata: data
};
var dataAdapter = new $.jqx.dataAdapter(source);
// perform Data Binding.
dataAdapter.dataBind();
var records = dataAdapter.getRecordsHierarchy(‘id’, ‘parentid’, ‘items’, [{ name: ‘text’, map: ‘label’}]);
$(‘#jqxWidget’).jqxTree({ source: records, width: ‘300px’ });
$(‘#jqxTree’).on(‘select’,function (event)
{
var args = event.args;
var item = $(‘#jqxTree’).jqxTree(‘getItem’, args.element);
//var label = item.label;
alert(item. ?? );
});