jQWidgets Forums

This topic contains 2 replies, has 2 voices, and was last updated by  Hristo 7 years, 4 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Nested JSON with JqxInput #97652

    ngc2
    Participant

    Hello,

    Is it possible to supply nested json data to the dataAdapter of a jqxInput?

    I am trying to do something like this, but the jqxInput’s autocomplete only registers the 1st level of people and nothing within the children array:

     
    let people = [
              {name: 'John', id: '1', children: [{name: 'Tyler', id: '2', children: []}]},
              {name: 'Susan', id: '3', children: []}
    ];
    this.source = {
            localdata: people,
            datafields: [
              {name: 'name'},
              {name: 'id'},
              {name: 'children', type: 'array' },
            datatype: 'json',
            hierarchy: { root: 'children'},
            id: 'id'
          };
    
    this.dataAdapter = new $.jqx.dataAdapter(this.source, {autoBind: true});

    This leads me to believe I am doing something wrong or this is not supported by jqxInput.

    Nested JSON with JqxInput #97654

    ngc2
    Participant

    Also I would like to add that I am trying to implement a search bar for a tree structure- hence the desire to search within nested JSON data.

    Nested JSON with JqxInput #97703

    Hristo
    Participant

    Hello ngc2,

    If you want to present hierarchical structure I would like to suggest you use jqxTree or jqxTreeGrid.
    I think it will be more helpful to use TreeGrid with only one column and there you could implement the filterable option.
    Please, take a look at this example.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.