代码如下:
- <script type="text/javascript">
- var datagrid;
- $(function(){
- $('#datagrid').datagrid({
- url:'{:U("Admin/Article/indexjson")}',
- title:'',
- iconCls:'icon-save',
- fit:true,
- //下面的page条
- pagination:true,
- pageSize:14,
- pageList:[14,20,30,40,50],
- //是否出现横向滚动条
- fitColumns:true,
- //数据折行
- nowrap:false,
- border:false,
- //帮你记住你选过的,做跨页删除
-
- idField:'id',
- columns:[[{
- title:'',
- field:'ck',
- checkbox:true,
- width:10,
- rowspan:2
- },{
- title:'ID',
- field:'id',
- width:50,
- rowspan:2,
- align:'center'
- },{
- title:'文章标题',
- field:'title',
- width:350,
- rowspan:2
- },{
- title:'属性',
- align:'center',
- colspan:3
- },{
- title:'所属栏目',
- field:'name',
- width:150,
- rowspan:2
- },{
- title:'所属专题',
- field:'name',
- width:150,
- rowspan:2
- },{
-
- title:'发布时间',
- field:'time',
- width:150,
- align:'center',
- rowspan:2
- }
- ],[
- {
- title:'推荐',
- field:'good',
- width:50,
- align:'center'
- },{
- title:'热门',
- field:'hits',
- width:50,
- align:'center'
- },{
- title:'图',
- field:'pic',
- width:50,
- align:'center'
- },
- ]],toolbar:"#tb"
- });
- });
- function doSearch(value){
- //alert('You input: ' + value);
- $('#datagrid').datagrid('load',{
- title:$('#tb').find('[name=search]').val()
- });
-
- }
- function doAdd(){
- //alert('You input: ' + value);
- }
- function doSave(value){
- alert('You input: ' + value);
- }
- function doDel(value){
- alert('You input: ' + value);
- }
- // function doSearch(value){
- // alert('You input: ' + value);
- // }
- </script>