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="name" placeholder="业主">
  12. </div>
  13. <div class="input-group">
  14. <input type="text" class="form-control" name="content" placeholder="资源名称">
  15. </div>
  16. <div class="input-group">
  17. <span class="input-group-btn">
  18. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  19. </span> &nbsp;
  20. <span class="input-group-btn">
  21. <button class="btn-sm btn-warning" type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  22. </span>
  23. </div>
  24. </form>
  25. </div>
  26. </div>
  27. </div>
  28. <div class="ibox-content">
  29. <div class="jqGrid_wrapper">
  30. <table id="table" style="border-collapse: collapse"></table>
  31. <div id="pager"></div>
  32. </div>
  33. </div>
  34. </div>
  35. {/block}
  36. {block name="script"}
  37. <script>
  38. $(function () {
  39. $(window).bind("resize",function(){
  40. var width=$(".jqGrid_wrapper").width();
  41. $("#table").setGridWidth(width);
  42. });
  43. $.jgrid.defaults.styleUI="Bootstrap";
  44. $("#table").jqGrid({
  45. url:"{:url('index')}",
  46. datatype: "json",
  47. colModel:[
  48. {label:'ID',name:'id',index:'id', width:20,sortable: false},
  49. {label:'业主',name:'name',index:'name',width:30,editable: false,sortable: false},
  50. {label:'电话',name:'phone',index:'phone',width:40,editable: false,sortable: false},
  51. {label:'身份证',name:'card',index:'card',width:60,editable: false,sortable: false},
  52. {label:'操作',name:'content',index:'content',width:160,editable: false,sortable: false},
  53. ],
  54. rowNum:10,
  55. rowList:[10,20,30,50,100],
  56. pager: '#pager',
  57. sortname: 'id',
  58. viewrecords: true,
  59. autowidth:true,
  60. mtype: 'post',
  61. height: 'auto',
  62. emptyrecords: "暂无数据",
  63. sortorder: "desc",
  64. caption:"{$m_name}列表",
  65. loadComplete: function (xhr) {
  66. if(xhr.code==0){
  67. layer.msg(xhr.msg);
  68. return false;
  69. }
  70. },
  71. });
  72. });
  73. </script>
  74. {/block}