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格式来解析数据。

posted on 2013-11-01 01:07  自信飞扬  阅读(24082)  评论(1编辑  收藏  举报

导航