Loading external JSON data into a data table

Can someone give me an example of how to populate a data table from an external JSON file?

For example, I’d like to display a data table of Old Faithful eruptions:

http://public.opencpu.org/ocpu/library/datasets/data/faithful/json

I was hoping it would be as easy as:

`
   webix.ui({view:"datatable",
               columns: [
                   {id: "waiting", header:"Waiting", width: 80 },
                   {id: "eruptions", header:"Eruptions", width: 80 }
               ],
               url = "http://public.opencpu.org/ocpu/library/datasets/data/faithful/json",
               autowidth:true
     });
`

But nothing happens. Do I need to make an ajax request somehow?

try this: http://webix.com/snippet/7c7471a0

Thanks! That works. The following works also.

`
var faithful = webix.ajax("http://public.opencpu.org/ocpu/library/datasets/data/faithful/json");

webix.ui({
  cols:[
    { rows:[ { view:"datatable", autoConfig:true, data:faithful }]}
  ]});
`

mine doesn’t work Please help me out this the url of the json dataset http://edawahtech.com/heduerp/edge/views/contractor_overview?display_id=page_3

i tried http://webix.com/snippet/7c7471a0 but the data is not loading

Works if you remove the “http:” from the url.

https://snippet.webix.com/pct7cpgj

@prasadraju
use this
url:"//public.opencpu.org/ocpu/library/datasets/data/faithful/json"

Is it possible to read specific variable data from json file instead of reading complete json file data for webix datatable?

for ex: If i want data from VAR2 variable content for my datatable if json file contains below information:

{VAR1:[
{ “id”:1, “title”:“The Shawshank Redemption”, “year”:1994, “votes”:678790, “rating”:9.2, “rank”:1},
{ “id”:2, “title”:“The Godfather”, “year”:1972, “votes”:511495, “rating”:9.2, “rank”:2}
],
VAR2:[
{ “id”:1, “title”:“The Shawshank Redemption”, “year”:1994, “votes”:678790, “rating”:9.2, “rank”:1},
{ “id”:2, “title”:“The Godfather”, “year”:1972, “votes”:511495, “rating”:9.2, “rank”:2}
]
}

Hey @ganeshkp, are you talking about something like this - https://snippet.webix.com/urdp612c, or is it something different?

@Dzmitry But same content will be in external json file. How to get that data if we use url to read json file.

In this case you should form a request to get the specific data from your server, it really depends on how your environment is set up.

If you are unable to do so, the only way to do this on the client side is by manually parsing the selected data after making the request, for example: https://snippet.webix.com/2mywehwq.

@Dzmitry Thanks for help.