{title:"发送人",field:"user",width:"180",align:"center"}    ,这个逗号是正常显示的,复制过来就跑到那里了,在代码里不是。
还有个问题,我在创建tab的时候,为什么加上这个参数selected:true
就可以显示json数据呢,不加上就光只有datagrid,没用数据。

解决方案 »

  1.   

    你少写了点东西
    <script type="text/javascript">
    $(function() {
    $('#feedback').datagrid( {
    url : 'feedback_data.json',
    title : "用户反馈 - 所有",
            width : "auto",
            striped : true,
            singleSelect : true,
            loadMsg : "正在加载,请稍等...",
            url : "feedback_data.json",
            pagination : true,
            rownumbers : true,
            pageList : [ 5, 10, 15, 20 ],
            pageSize : 10,
            idField:"id",
            columns:[[
            {title:"发送人",field:"user",width:"180",align:"center"}    ,
            {title:"反馈内容",field:"title",width:"300",align:"center"},
            {title:"时间",field:"sendTime",width:"300",align:"center"}
            ]]
    });
    });
    </script>这样才对
      

  2.   

    请在前面加上 :$(document).ready(function() {............这里加上你的那代码});