jQuery MiniUI

标题: datagrid显示不出来 [打印本页]

作者: onlysam    时间: 2012-11-20 13:14:13     标题: datagrid显示不出来

本帖最后由 onlysam 于 2012-11-20 13:19 编辑

[attach]982[/attach]

管理员你好
我用的是.net后台返回json数据的形式
但是10次里有8次前台显示不出来,~很奇怪

我把我后台返回的json 代码copy到txt里 没有问题

但是后台json返回就不行

前台是:
<body>
<div id="datagrid1" class="mini-datagrid" style="width:700px;height:280px;" url="../ashx/DataService.ashx"  idField="id" allowResize="true">
    <div property="columns">
        <div type="indexcolumn" ></div>
        <div field="Loginname" width="120" headerAlign="center" allowSort="true">员工帐号</div>   
        <div field="Name" width="120" headerAlign="center" allowSort="true">姓名</div>                           
        <div field="Gender" width="100" renderer="onGenderRenderer" align="center" headerAlign="center">性别</div>
        <div field="Salary" width="100" allowSort="true">薪资</div>                                    
        <div field="Age" width="100" allowSort="true">年龄</div>
        <div field="Createtime" width="100" headerAlign="center" dateFormat="yyyy-MM-dd" allowSort="true">创建日期</div>               
    </div>
</div>
<script type="text/javascript">
mini.parse();
var grid = mini.get("datagrid1");
grid.load();
</script>
</body>

以下是我后台返回的json代码
{"total":5,"data":[{"Loginname":"qq3213210","Name":"安慰0","Gender":"男","Salary":"330","Age":"20","Createtime":"2012-11-0"},{"Loginname":"qq3213211","Name":"安慰1","Gender":"男","Salary":"331","Age":"21","Createtime":"2012-11-1"},{"Loginname":"qq3213212","Name":"安慰2","Gender":"男","Salary":"332","Age":"22","Createtime":"2012-11-2"},{"Loginname":"qq3213213","Name":"安慰3","Gender":"男","Salary":"333","Age":"23","Createtime":"2012-11-3"},{"Loginname":"qq3213214","Name":"安慰4","Gender":"男","Salary":"334","Age":"24","Createtime":"2012-11-4"}]}



作者: factory    时间: 2012-11-20 14:34:56

你在ashx里面加上String name = context.Request["name"];这一行代码试试。




欢迎光临 jQuery MiniUI (http://miniui.com/discuss/) Powered by Discuz! X2