easyui datagrid 无数据信息提示

来源:互联网 发布:国外类似知乎的网站 编辑:程序博客网 时间:2024/05/25 05:37

一、表格无数据提示:

 $("#acrossDeptApply").datagrid({
                          pagination:true,
                          url:'${pageContext.request.contextPath}'+
                      '/credit/data/findAcrossInfo.action?deptId='+deptId+'&startDate='+startDate
                              +'&endDate='+endDate+'&status='+status,
                          pageSize:10,
                          pageList:[10,20,30,50],
                          fitColumns:true,
                          nowrap:true,
                          rownumbers:true,
                           columns:[[
                                    {field:'applyDeptName',title:'部门',width:100,align:'center'},
                                    {field:'applyName',title:'申请人',width:100,align:'center'},
                                    {field:'phone',title:'联系电话',width:100,align:'center'},
                                    {field:'status',title:'状态',width:100,align:'center',formatter:
                                        function(value,row,index){
                                        return value==1?"待审核":(value==2?"通过":(value==3?"未通过":"已撤回"));
                                    }},
                                    {field:'applyTime',title:'申请时间',align:'center',width:100,formatter:
                                        function(value,row,index){
                                        var date = new Date(value);
                                        var year= date.getFullYear();
                                        var month = date.getMonth()+1;
                                        var day = date.getDate();
                                        return year+"-"+month+"-"+day;
                                    }},
                                    {field:'action',title:'操作',align:'center',width:100,formatter:
                                        function(value,row,index){
                                        return "<a style='text-decoration:none;' href='#' onclick=check("+row.id+");>审核</a>&nbsp;&nbsp;"
                                                +"<a style='text-decoration:none;' href='#' onclick=checkDetail("+row.id+");>查看申请信息</a>"
                                    }}
                                    ]],
                                    //表单无记录提示
                               onLoadSuccess:function(data){
                                   if (data.total<1){
                                      $.messager.alert("提示","表单无数据!");
                                 }
                                  
                               }
                      });

二、追加一行记录提示没有数据:

$('#acrossDeptApply').datagrid('appendRow',{中间显示的列的字段名称: '没有相关记录'
0 0
原创粉丝点击