get_sos_list.html 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <div class="ibox">
  4. <div class="ibox-content">
  5. <div class="row">
  6. </div>
  7. </div>
  8. <div class="ibox-content">
  9. <div class="jqGrid_wrapper">
  10. <table id="table" style="border-collapse: collapse"></table>
  11. <div id="pager"></div>
  12. </div>
  13. </div>
  14. </div>
  15. {/block}
  16. {block name="script"}
  17. <script type="text/javascript" src="/static/layDate-v5.0.9/laydate.js"></script>
  18. <script>
  19. $(function () {
  20. laydate.render({
  21. elem: '#time'
  22. ,format: 'yyyy-MM-dd',
  23. trigger: 'click' ,
  24. });
  25. $(window).bind("resize",function(){
  26. var width=$(".jqGrid_wrapper").width();
  27. $("#table").setGridWidth(width);
  28. });
  29. $.jgrid.defaults.styleUI="Bootstrap";
  30. $("#table").jqGrid({
  31. url:"{:url('getSosList')}",
  32. datatype: "json",
  33. colModel:[
  34. {label:'时间',name:'created_at',index:'created_at',width:40,editable: false,sortable: false},
  35. {label:'地址',name:'address',index:'address',width:100,editable: false,sortable: false},
  36. ],
  37. rowNum:10,
  38. rowList:[10,20,30,50,100],
  39. pager: '#pager',
  40. sortname: 'id',
  41. viewrecords: true,
  42. autowidth:true,
  43. mtype: 'post',
  44. height: 'auto',
  45. emptyrecords: "暂无数据",
  46. sortorder: "desc",
  47. caption:"呼救列表",
  48. loadComplete: function (xhr) {
  49. if(xhr.code==0){
  50. layer.msg(xhr.msg);
  51. return false;
  52. }
  53. },
  54. });
  55. });
  56. </script>
  57. {/block}