jquery - 如何在 jqgrid 中对齐中心搜索弹出窗口

标签 jquery css jqgrid

我在 jqgrid 中对齐中心 Search popup 时遇到问题。当我单击 jqgrid 中的搜索按钮时,搜索弹出窗口显示在网格的开头。

$(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.jqgrid.css 文件中的 .ui-jqdialog 类。

jqgrid 搜索弹出窗口通过添加 css 属性对齐中心 left: 30% !important; 顶部:40% !important;.ui-jqdialog 类中

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

关于jquery - 如何在 jqgrid 中对齐中心搜索弹出窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21846860/

相关文章:

javascript - 创建一个按钮来控制 JavaScript 创建一些元素。然后,如果这些元素中的任何一个发生变化,请执行某些操作

javascript - 防止表单提交到不同页面

html - Asp 复选框列表的对齐问题

jquery - jqGrid 缓存网格数据

渲染部分 rails 后 JavaScript 不工作

javascript - 在 jqgrid 中传递一个对象

CSS "table-layout: fixed"和由内部内容自动调整宽度的单元格

css - 使用 CSS 防止固定标题隐藏文本

javascript - jqGrid 强制过滤器触发

jquery - jqGrid - 保存复选框选定状态