EasyUI Forum
April 30, 2024, 12:21:42 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data  (Read 20570 times)
zh_CN
Newbie
*
Posts: 32



View Profile Email
« on: May 10, 2014, 02:37:00 AM »

editor in treegrid load remote json error

Quote
...
        {field: 'pid', title: '上级',  align: 'center', width: 100, editor: {
            type: 'combotree',
            options: {
                //url: '/admin.php?s=/MDepartment/getJson',
                url: 'http://www.jeasyui.com/demo/main/tree_data1.json',
                //valueField: "value", textField: 'name',
            }
         }},
...

Please see the attachments

thinks a lot!
Logged

From the great China
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: May 10, 2014, 03:21:04 AM »

For some security reasons, cross-domain accessing is denied. Please try to move the resource files to your own domain.
Logged
zh_CN
Newbie
*
Posts: 32



View Profile Email
« Reply #2 on: May 10, 2014, 04:10:31 AM »

For some security reasons, cross-domain accessing is denied. Please try to move the resource files to your own domain.

Thanks, but i have a little problem yet:
Code:
...
editor: {
            type: 'combotree',
            options: {
                url: 'http://e.chinaxiaogao.com/admin.php?s=/MDepartment/getJson',
            }
...

My url return json is not standard  combotree data:
[{"id":"100","name":"门店" ...

I want to chang  "name" to "text" (chang in eayui html, not in php),  it become to a stand combotree data. How to do?

treegrid can define:   idField:'id' treeField:'name', and combotree how to do?

thanks!
« Last Edit: May 10, 2014, 04:31:48 AM by zh_CN » Logged

From the great China
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: May 10, 2014, 04:59:46 AM »

You need to define the loadFilter function to convert your original data to standard tree data. Please refer to this topic http://www.jeasyui.com/forum/index.php?topic=1265.0
Logged
zh_CN
Newbie
*
Posts: 32



View Profile Email
« Reply #4 on: May 10, 2014, 05:01:27 AM »

You need to define the loadFilter function to convert your original data to standard tree data. Please refer to this topic http://www.jeasyui.com/forum/index.php?topic=1265.0

Ok, Thanks!
Logged

From the great China
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!