如何对齐中心搜索弹出在jqgrid

如何对齐中心搜索弹出在jqgrid

本文介绍了如何对齐中心搜索弹出在jqgrid的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题,要在 jqgrid 中对齐中心搜索弹出。当我点击jqgrid中的搜索按钮时,搜索弹出窗口显示在网格的开头。

I have a problem to align center Search popup in jqgrid. When I click on search button in jqgrid the Search popup is displayed in starting of the grid.

$(document).ready(function(){
            //jqGrid
            $("#usersList").jqGrid({
                url:'<%=request.getContextPath() %>/getUsersList',
                datatype: "json",
                colNames:['Edit','Primary Email','Active','First Name','Middle Name','LastName','Mobile Number'],
                colModel:[
                    {name:'userId',search:false,index:'userId',width:30,sortable: false},
                    {name:'email',index:'user.primaryEmail',width:150},
                    {name:'isActive',index:'user.isActive',width:80},
                    {name:'firstName',index:'firstName', width:100},
                    {name:'middleName',index:'middleName', width:100},
                    {name:'lastName',index:'lastName', width:100},
                    {name:'mobileNo',index:'user.mobileNo', width:100},
                    ],
                    rowNum:20,
                    rowList:[10,20,30,40,50],
                    rownumbers: true,
                    pager: '#pagerDiv',
                    sortname: 'user.primaryEmail',
                    viewrecords: true,
                    sortorder: "asc",
                    autowidth:'true',
            });
            $('#gridContainer div:not(.ui-jqgrid-titlebar)').width("100%");
            $('.ui-jqgrid-bdiv').css('height', window.innerHeight * .65);
            $('#load_usersList').width("130");
            $("#usersList").jqGrid('navGrid','#pagerDiv',{edit:false,add:false,del:false},{},{},{}, {closeAfterSearch:true});
            $(".inline").colorbox({inline:true, width:"20%"});
        });


推荐答案

已更新 .ui-jqdialog

Updated .ui-jqdialog class in ui.jqgrid.css file.

ui.jqgrid.css 文件中添加css属性 c $ c> left:30%!important;
top:40%!important; in .ui-jqdialog class

jqgrid search popup is align center by adding css attributes left: 30% !important; top: 40% !important; in .ui-jqdialog class

.ui-jqdialog {
    display: none;
    width: 300px;
    position: absolute;
    padding: .2em;
    font-size: 11px;
    overflow: visible;
    left: 30% !important;
    top: 40% !important;
}

这篇关于如何对齐中心搜索弹出在jqgrid的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 13:16