Webix tree view from json file

Hi,
I am trying to see trial sample examples to load data from json file. I am looking at below file:
webix.trial.complete/webix/samples/17_datatree/01_loading/01_json_data.html

But i am not seeing data for exmples which loads data from json file. It is showing below error on console:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at file:///C:/WORK/WEBIX/webix.trial.complete/webix/samples/17_datatree/01_loading/data/data.json. (Reason: CORS request not http).

Can you please check

Tagged:

Comments

  • edited November 2019

    Hello @ganeshkp,

    But i am not seeing data for exmples which loads data from json file. It is showing below error on console:

    You will need to deploy a local server to see this example in action. Please run the following command in the terminal from within your Webix folder:

    npm run server
    

    You will then see a message similar to this:

    Server is running on port 3000...
    Open http://localhost:3000/samples in browser

    Follow the link that was provided you and check the snippet you are interested in.

  • @Dzmitry I have not used npm before. Can you please elaborate, how to invoke npm. Do i need to install any software for it?
    Thanks for help.

  • edited November 2019

    @Dzmitry I could be able to run above specified commands and able to see sample data.

    I am trying to implement the same on my project. I copied all folders from webix.trial.complete\webix except samples folder into my project folder. and running it. But it is giving same http://localhost:3000/samples.

    Do i need to consider any changes to be done for my project?

    Note: I am trying to read external json file into webix tree view..

  • I copied all folders from webix.trial.complete\webix except samples folder into my project folder. and running it. But it is giving same http://localhost:3000/samples.

    I'm assuming you are trying to run the same command (npm run server)? Unfortunately, the way the scripts are set up means that these commands are static, and will always execute the same actions. In order for your example to work you will need to host (either locally or online) both your project and the external file. In your case a simple local server hosting your project is enough (you can also place the file somewhere inside the hosted directory - it is essentially an external file).

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!