从官网下了datagrid 的一个小demo,有一个html文件和.json数据文件,怎么配置才能看到grid中显示json数据呢

解决方案 »

  1.   

    json数据,只能从后台传啊,
    举个简单的,
    把一个字符串,
    传到前台后
    但,一定要注意格式
      

  2.   


    用url方式已经指定了数据文件的路径啊,这是源代码:
    <table id="tt" title="Formatting Columns" class="easyui-datagrid" style="width:550px;height:250px"
    url="data/datagrid_data.json"
    singleSelect="true" iconCls="icon-save">
    <thead>
    <tr>
    <th field="id" width="80">Item ID</th>
    <th field="name" width="80">Product ID</th>
    <th field="sortid" width="80" align="right" formatter="formatPrice">List Price</th>
    <th field="valid" width="80" align="right">Unit Cost</th> </tr>
    </thead>
    </table>