EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: zh_CN on May 10, 2014, 02:37:00 AM



Title: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data
Post by: zh_CN 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!


Title: Re: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data
Post by: stworthy 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.


Title: Re: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data
Post by: zh_CN 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!


Title: Re: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data
Post by: stworthy 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


Title: Re: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data
Post by: zh_CN 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!