jQWidgets Forums

jQuery UI Widgets Forums TreeGrid Children not being rendered for nested JSON

This topic contains 1 reply, has 1 voice, and was last updated by  cong 10 years, 2 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author

  • cong
    Participant

    Hi, I have a large nested JSON format, which have 2 different roots. The data has a structure as follows: http://pastebin.com/ZTA8MQ7F. I wish to only display the ‘value’ key of each object – basically just a tree. This is the code that I currently have:

    var source = {
    	dataType: 'json',
    	dataFields: [
    		{name: 'cellType', type: 'string'},
    		{name: 'instanceName', type: 'string'},
    		{name: 'value', type: 'string'},
    		{name: 'moduleName', type: 'string'}
    		],
    	hierarchy: {root: 'data'},
    	localData: event.data //takes in data that has structure as the pastebin
    };
    
    var dataAdapter = new $.jqx.dataAdapter(source);
    
    $('#tree').jqxTreeGrid({
    width: '100%',
    source: dataAdapter,
    columns: [
    	{text: 'Cells', dataField: 'value', width: '100%'}
    	]
    });

    This however displays:
    ‘Top Level’
    ‘Subcircuits’
    without any children. May I please have some pointers to what I’m doing incorrectly?

    Thank you for your time


    cong
    Participant

    I made a typo in the source code. Everything is working now

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.