EasyUI Forum
September 14, 2025, 04:48:34 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: loading json from remote URL not working  (Read 11076 times)
rahul.sanjose
Newbie
*
Posts: 8


View Profile
« on: November 27, 2012, 03:59:47 PM »

Hi,

I have a treegrid which is using the local json file. However, I made the data-options URL remote and the tree grid stopped working. I can see a call being made to remote data file and then a 200 ok response in firebug. However, the data is not displayed.

Before:
Code:
	<table id="tt" title="TreeGrid" class="easyui-treegrid" style="width:700px;height:300px"
data-options="url:'test.json',idField:'id',treeField:'code',

After(data not getting loaded from remote URL):
Code:
	<table id="tt" title="TreeGrid" class="easyui-treegrid" style="width:700px;height:300px"
data-options="url:'http://remote-host/test.json',idField:'id',treeField:'code',

Could someone please help?
« Last Edit: November 27, 2012, 04:01:32 PM by rahul.sanjose » Logged
rahul.sanjose
Newbie
*
Posts: 8


View Profile
« Reply #1 on: November 27, 2012, 04:14:19 PM »

Even I tried the following. Its not working either. Sad

Code:
 $(document).ready(function(){ 
var mydata;
$.getJSON("http://remote-host/test.json", function(json) {
  mydata = json;
});
$('#tt').datagrid('loadData', mydata); alert('here');}
 )
Logged
rahul.sanjose
Newbie
*
Posts: 8


View Profile
« Reply #2 on: November 27, 2012, 08:05:08 PM »

I think I ran into the same origination policy issue. When I copied over the JS files to the remote-host, its working fine.

I read somewhere that getJson uses a different protocol. I am wondering if there is a work around for this issue that I just ran into.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!