index.html 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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>&nbsp;
  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:'nums',index:'nums', width:40,sortable: false},
  48. {label:'价格',name:'price',index:'price', width:40,sortable: false},
  49. {label:'备注',name:'remark',index:'remark', width:60,sortable: false},
  50. {label:'操作人',name:'userName',index:'userName', width:40,sortable: false},
  51. {label:'操作时间',name:'create_time',index:'create_time', width:60,sortable: false},
  52. ],
  53. rowNum:10,
  54. rowList:[10,20,30,50,100],
  55. pager: '#pager',
  56. sortname: 'id',
  57. viewrecords: true,
  58. autowidth:true,
  59. mtype: 'post',
  60. height: 'auto',
  61. emptyrecords: "暂无数据",
  62. sortorder: "desc",
  63. caption:"{$meta_title}",
  64. loadComplete: function (xhr) {
  65. if(xhr.code==0){
  66. layer.msg(xhr.msg);
  67. return false;
  68. }
  69. },
  70. });
  71. });
  72. </script>
  73. {/block}