读书人

Jquery easyui的DataGrid合asp.net

发布时间: 2012-08-13 13:21:53 作者: rapoo

Jquery easyui的DataGrid合asp.net定

JScript code
 $(document).ready(function () {            $('#list').datagrid({                title: '查果',                iconCls: 'icon-save',                width: 800,                height: 250,                url: "../WebForm4.aspx",                columns: [[                { field: 'name', title: '名字', width: 100 },                { field: 'value', title: '年', width: 100, align: 'right' }            ]],                pagination: true,                rownumbers: true            });        });

我前用了Jquery easyui的DataGrid控件,我知道要伺服器要返回json,但是我不知道在WebForm4.aspx怎返回json
我想在WebForm4.aspx行作查sql句 select name,value from userinf 查出的,那我怎把它成json象返回前的DataGrid控件定呢

[解决办法]
stringBuider 拼接字符串就OK

json 是键值对

这就是 json

columns: [[
{ field: 'name', title: '名字', width: 100 },
{ field: 'value', title: '年', width: 100, align: 'right' }
]]


实际上就是一个字符串


好比xml. 也是字符串。
他们都有自己的规则罢了

读书人网 >JavaScript

热点推荐