index.html 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <div class="ibox">
  4. <div class="ibox-content">
  5. <div class="row">
  6. <div class="col-xs-3">
  7. </div>
  8. <div class="col-xs-9" style="text-align: right;">
  9. <form class="form-inline" id="form-search" action="{:url('index')}">
  10. <div class="input-group">
  11. <input type="text" class="form-control" name="title" placeholder="物品名称">
  12. </div>
  13. <div class="input-group">
  14. <span class="input-group-btn">
  15. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  16. </span>
  17. <span class="input-group-btn">
  18. <button class="btn-sm btn-primary " type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  19. </span>
  20. </div>
  21. </form>
  22. </div>
  23. </div>
  24. </div>
  25. <div class="ibox-content">
  26. <div class="jqGrid_wrapper">
  27. <table id="table" style="border-collapse: collapse"></table>
  28. <div id="pager"></div>
  29. </div>
  30. </div>
  31. </div>
  32. {/block}
  33. {block name="script"}
  34. <script>
  35. $(function () {
  36. $(window).bind("resize",function(){
  37. var width=$(".jqGrid_wrapper").width();
  38. $("#table").setGridWidth(width);
  39. });
  40. $.jgrid.defaults.styleUI="Bootstrap";
  41. $("#table").jqGrid({
  42. url:"{:url('index')}",
  43. datatype: "json",
  44. colModel:[
  45. {label:'编号',name:'id',index:'id', width:40,sortable: false},
  46. {label:'物品名称',name:'title',index:'title', width:60,sortable: false},
  47. {label:'操作人',name:'userName',index:'userName', width:40,sortable: false},
  48. {label:'数量',name:'nums',index:'nums', width:40,sortable: false},
  49. {label:'备注',name:'remark',index:'remark', width:60,sortable: false},
  50. {label:'操作时间',name:'create_time',index:'create_time', width:60,sortable: false},
  51. ],
  52. rowNum:10,
  53. rowList:[10,20,30,50,100],
  54. pager: '#pager',
  55. sortname: 'id',
  56. viewrecords: true,
  57. autowidth:true,
  58. mtype: 'post',
  59. height: 'auto',
  60. emptyrecords: "暂无数据",
  61. sortorder: "desc",
  62. caption:"{$meta_title}",
  63. loadComplete: function (xhr) {
  64. if(xhr.code==0){
  65. layer.msg(xhr.msg);
  66. return false;
  67. }
  68. },
  69. });
  70. });
  71. </script>
  72. {/block}