123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- {extend name="common/common2" /}
- {block name="main"}
- <div class="ibox">
- <div class="ibox-content">
- <div class="row">
- <div class="col-xs-3">
- <a href="{:url('index')}" class="btn btn-sm btn-primary">返回上一页</a>
- </div>
- </div>
- </div>
- <div class="ibox-content">
- <div class="jqGrid_wrapper">
- <table id="table" style="border-collapse: collapse"></table>
- <div id="pager"></div>
- </div>
- </div>
- </div>
- {/block}
- {block name="script"}
- <script>
- $(function () {
- $(window).bind("resize",function(){
- var width=$(".jqGrid_wrapper").width();
- $("#table").setGridWidth(width);
- });
- $.jgrid.defaults.styleUI="Bootstrap";
- $("#table").jqGrid({
- url:"{:url('record',['id'=>$id])}",
- datatype: "json",
- colModel:[
- {label:'ID',name:'id',index:'id', width:30,sortable: false},
- {label:'昵称',name:'user_id',index:'user_id',width:80,editable: false,sortable: false,
- formatter:function (a,b,c){
- return '游客';
- }},
- {label:'ip',name:'ip',index:'ip',width:80,editable: false,sortable: false},
- {label:'创建时间',name:'create_time',index:'create_time',width:60,sortable: true},
- {label:'操作',width:50,sortable: false,formatter: function (a, b, c) {
- var info_url = "{:url('info',[],'')}/id/"+c.id;
- var btn = '<a url="'+info_url+'" href="javascript:;" data-title="详情" onclick="layer_open(this,1)"><span class="label label-primary" title="详情">详情</span></a>';
- return btn;
- }},
- ],
- rowNum:10,
- rowList:[10,20,30,50,100],
- pager: '#pager',
- sortname: 'id',
- viewrecords: true,
- autowidth:true,
- mtype: 'post',
- height: 'auto',
- emptyrecords: "暂无数据",
- sortorder: "desc",
- caption:"{$m_name}列表",
- loadComplete: function (xhr) {
- if(xhr.code==0){
- layer.msg(xhr.msg);
- return false;
- }
- },
- });
- });
- </script>
- {/block}
|