码迷,mamicode.com
首页 > 其他好文 > 详细

jqgrid学习琐记---shrinkToFit--特别的是

时间:2014-06-27 20:39:58      阅读:3124      评论:0      收藏:0      [点我收藏+]

标签:des   style   blog   http   java   ext   

  <body>
  <div style="margin:30px;">
  <table id="list4"></table>
  <div id="pager5"></div>
  </div>
<br />
<a href="#" id="a1">Get data from selected row</a>
<br />
<a href="#" id="a2">Delete row 2</a>
<br />
<a href="#" id="a3">Update amounts in row 1</a>
<br />
<a href="#" id="a4">Add row with id 99</a>
<br />
</body>
<script type="text/javascript">
var mydata = [
        {id:"1",invdate:"2007-10-01",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
        {id:"2",invdate:"2007-10-02",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
        {id:"3",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
        {id:"4",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
        {id:"5",invdate:"2007-10-05",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
        {id:"6",invdate:"2007-09-06",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
        {id:"7",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
        {id:"8",invdate:"2007-10-03",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
        {id:"9",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"}/*,
        {id:"10",invdate:"2007-10-01",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
        {id:"11",invdate:"2007-10-01",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
        {id:"12",invdate:"2007-10-02",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
        {id:"13",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
        {id:"14",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
        {id:"15",invdate:"2007-10-05",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
        {id:"16",invdate:"2007-09-06",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
        {id:"17",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
        {id:"18",invdate:"2007-10-03",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
        {id:"19",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"}*/
        ];
jQuery("#list4").jqGrid({
    datatype: ‘local‘,
    //dataStr:
    height:300,   
       colNames:[‘Inv No‘,‘Date‘, ‘Client‘, ‘Amount‘],
       colModel:[
           {name:‘id‘,index:‘id‘, width:60, sorttype:"int"},
           {name:‘invdate‘,index:‘invdate‘, width:90, sorttype:"date"},
           {name:‘name‘,index:‘name‘, width:100},
           {name:‘amount‘,index:‘amount‘, width:100, align:"right",sorttype:"float"},
          
       ],     
       pager: ‘#pager5‘,
       sortname: ‘id‘,
    viewrecords: true,
    sortorder: "desc",  
    shrinkToFit:true,
    scroll:true,
       caption: "Manipulating Array Data"
});

for(var i=0;i<=mydata.length;i++)
    jQuery("#list4").jqGrid(‘addRowData‘,i+1,mydata[i]);   
   
</script>

bubuko.com,布布扣bubuko.com,布布扣

jqgrid学习琐记---shrinkToFit--特别的是,布布扣,bubuko.com

jqgrid学习琐记---shrinkToFit--特别的是

标签:des   style   blog   http   java   ext   

原文地址:http://www.cnblogs.com/lyl2001431/p/3809504.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!