您当前的位置: 首页 >  数据结构

杨林伟

暂无认证

  • 1浏览

    0关注

    3337博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

36jqGrid 数据结构 - XML结构

杨林伟 发布时间:2019-04-24 14:02:16 ,浏览量:1

从现在的开始,jqGrid支持任意结构的XML和json数据。 在这个版本中,我们引入了xmlReader 和jsonReader。 这样,我们就可以分析和显示这些数据的数据结构,更多的信息在将来的分当中有所体现。 在这里插入图片描述

HTML代码举例

  
    jqGrid 实例
  
  
    ···代码省略···
    
    ···代码省略···
  

		
javascript代码举例
$(function(){
  pageInit();
});
function pageInit(){
  jQuery("#list19").jqGrid({
    url : 'books.xml',
    datatype : "xml",
    colNames : [ "Author", "Title", "Price", "Published Date" ],
    colModel : [ 
                 {name : "Author",index : "Author",width : 120,xmlmap : "ItemAttributes>Author"}, 
                 {name : "Title",index : "Title",width : 180,xmlmap : "ItemAttributes>Title"}, 
                 {name : "Price",index : "Manufacturer",width : 100,align : "right",xmlmap : "ItemAttributes>Price",sorttype : "float"}, 
                 {name : "DatePub",index : "ProductGroup",width : 130,xmlmap : "ItemAttributes>DatePub",sorttype : "date"} 
               ],
    height : 250,
    rowNum : 10,
    rowList : [ 10, 20, 30 ],
    viewrecords : true,
    loadonce : true,
    xmlReader : {
      root : "Items",
      row : "Item",
      repeatitems : false,
      id : "ASIN"
    },
    caption : "XML Mapping example"
  });
}
books.xml



True

Books





John Grisham
A Time to Kill
12.99
1998-05-01
0446351230





Stephen King
Blood and Smoke
24.00
2000-01-01
0446355453





John Grisham
The Rainmaker
7.99
2001-12-01
0443622434





Stephen King
The Green Mile
24.00
1992-01-01
0443622987





Stephen King
Misery
7.70
2003-01-01
0443623452





Stephen King
The Dark Half
48.00
1999-10-30
0443623482





John Grisham
The Partner
12.99
2005-01-01
0443744434





Stephen King
It
9.70
2001-10-15
0443698452





Honore de Balzac
Cousin Bette
19.70
1991-12-01
0443691234





Alexandr Pushkin
Boris Godunov
7.15
1999-01-01
0447791234





Alice in Wonderland
Lewis Carroll
4.15
1999-01-01
0447791294




关注
打赏
1662376985
查看更多评论
立即登录/注册

微信扫码登录

0.3954s