easyui datagrid json 格式

{                                                     
    "total":239,                                                     
    "rows":[                                                         
        {"code":"001","name":"Name 1","addr":"Address 11","col4":"col4 data"},        
        {"code":"002","name":"Name 2","addr":"Address 13","col4":"col4 data"},        
        {"code":"003","name":"Name 3","addr":"Address 87","col4":"col4 data"},        
        {"code":"004","name":"Name 4","addr":"Address 63","col4":"col4 data"},        
        {"code":"005","name":"Name 5","addr":"Address 45","col4":"col4 data"},        
        {"code":"006","name":"Name 6","addr":"Address 16","col4":"col4 data"},         
        {"code":"007","name":"Name 7","addr":"Address 27","col4":"col4 data"},         
        {"code":"008","name":"Name 8","addr":"Address 81","col4":"col4 data"},         
        {"code":"009","name":"Name 9","addr":"Address 69","col4":"col4 data"},         
        {"code":"010","name":"Name 10","addr":"Address 78","col4":"col4 data"}    
    ]                                                         
}

一般需要total和rows,需要注意的是必须用双引号括起来,否则会无法解析数据出错,原因jquery 1.8版本严格按照JSON格式来解析数据。

所以需要两个变量:total和rows

rows是List集合的形式

上一篇:nefu 519 昨日重现


下一篇:jquery-ui sortable 在拖动换位置时改变元素的大小导致占位与实际不一致