Easyui datagrid-easyui DataGrid data does not show the problem

Source: Internet
Author: User
Keywords Easyui DataGrid data Display Easyui PHP
Easyui DataGrid Data Display easyuiphp

With the development of Php+easyui do, Easyui DataGrid bound data source has a problem, that is, the data is not displayed.

The original in win under the development, so write is so, by the Stufamilyjson method to put the code:

public function stuFamilyJson(){    $tb=D('StuFamily');    $familyInfo=$tb->where('stu_id='.session('userId'))->select();    foreach ($familyInfo as $key=>$familyInfoEach)                $familyInfo[$key]=$tb->parseFieldsMap($familyInfoEach);    echo $familyInfo=json_encode($familyInfo);     }

Using the browser Developer tool, the following values are returned:

[{"id":"1","stuId":"1","folkName":"\u7236\u4eb2\u5927\u4eba","folkRelation":"\u7236\u5b50","folkCompany":"\u7236\u4eb2\u7684\u5355\u4f4d","folkPosition":"\u5de5\u4eba2","folkTel":"12345678910","folkAddress":"\u7ed9\u5927\u5bb6\u8bf4\u670di\u4e3au\u5346"},{"id":"2","stuId":"1","folkName":"\u6bcd\u4eb2\u5927\u4eba","folkRelation":"\u6bcd\u5b50","folkCompany":"\u6bcd\u4eb2\u7684\u5355\u4f4d","folkPosition":"\u5de5\u4eba","folkTel":"12345678910","folkAddress":"\u5bf9\u65b9\u7b54\u590d"},{"id":"6","stuId":"1","folkName":"\u5144\u957f\u5927\u4eba","folkRelation":"\u5144\u5f1f","folkCompany":"\u65e0","folkPosition":"\u65e0","folkTel":"123456","folkAddress":"\u70ed\u70ed\u70ed\u4ed6 \u5c14\u7279\u8ba9\u4ed6"}]

Note: This part of the Chinese characters are encoded, here do not restore.

But now write this, the front desk will not show the data!

Paste the returned data directly into a JSON file, and the URL changes to the JSON file, which will display correctly.
However, this is not a good way, after all, to interact with the database, of course, you may say let the background operation, the result is written to the JSON file, so it is true, but I do not like it.
And thought of this:

So the discovery can also be displayed normally.

Then, the question comes, I directly write the URL and so with JS write what is the difference? Why is there a problem with direct URL writing? There is another ComboBox, also written with the URL, just finished, after a few days it is not good to make, do not know what is the reason, I think the two are the same cause. Ask the great God for help!!

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.