0

在我的网格中,我有一个用于单个搜索的图标搜索,但搜索对话框确认一直在左上角弹出。我想让搜索对话框确认在 jqgrid 的中心,而不是在左上角。这是我的代码..

  <script type="text/javascript">
    jq(function() {
        jq("#grid").jqGrid({
            url:'/SpringGrid/yudi/crud',
            datatype: 'json',
            mtype: 'GET',
            colNames:['Id', 'First Name', 'Last Name'],
            colModel:[
                {name:'id',index:'id', width:55,editable:false,editoptions:{readonly:true,size:10},hidden:true},
                {name:'firstName',index:'lastName', width:100,editable:true, editrules:{required:true}, editoptions:{size:10},sortable:true},
                {name:'lastName',index:'firstName', width:100,editable:true, editrules:{required:true}, editoptions:{size:10},sortable:true}
            ],
            postData: {
            },
            rowNum:20,
            rowList:[20,40,60],
            height: 200,
            autowidth: true,
            rownumbers: true,
            pager: '#pager',
            sortname: 'id',
            viewrecords: true,
            sortorder: "asc",
            caption:"Users",
            emptyrecords: "Empty records",
            loadonce: false,
            loadComplete: function() {
            },
            jsonReader : {
                root: "rows",
                page: "page",
                total: "total",
                records: "records",
                repeatitems: false,
                cell: "cell",
                id: "id"
            }
        });
        jq("#grid").jqGrid('navGrid','#pager',
                {edit:false,add:false,del:false,search:true},
                { },
                { },
                { },
                {
                    sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'],
                    closeOnEscape: true,
                    multipleSearch: true,
                    closeAfterSearch: true }
        );



        jq("#grid").navButtonAdd('#pager',
                {   caption:"Add",
                    buttonicon:"ui-icon-plus",
                    onClickButton: addRow,
                    position: "last",
                    title:"",
                    cursor: "pointer"
                }
        );

        jq("#grid").navButtonAdd('#pager',
                {   caption:"Edit",
                    buttonicon:"ui-icon-pencil",
                    onClickButton: editRow,
                    position: "last",
                    title:"",
                    cursor: "pointer"
                }
        );

        jq("#grid").navButtonAdd('#pager',
                {   caption:"Delete",
                    buttonicon:"ui-icon-trash",
                    onClickButton: deleteRow,
                    position: "last",
                    title:"",
                    cursor: "pointer"
                }
        );

        jq("#btnFilter").click(function(){
            jq("#grid").jqGrid('searchGrid',
                    {multipleSearch: false,
                     },
                        sopt:['eq']}
            );
        });

        // Toolbar Search
        jq("#grid").jqGrid('filterToolbar',{stringResult: true, searchOnEnter : true});

    });
</script>
4

2 回答 2

0

1) 文件名:ui_jqgrid.css

上一篇: .ui-jqdialog { 显示:无;宽度:300px;位置:绝对;填充:.2em;字体大小:11px;溢出:可见;}

修改的:

.ui-jqdialog { display: none;float: left;font-size: 13px;height: 100px;left: 40% !important;overflow: hidden;position: absolute;top: 30% !important;z-index: 200 ;}

于 2014-02-18T09:52:38.730 回答
0

这是我用来在窗口中心显示网格的样式,因为有时网格的中心不会在显示区域中。

.ui-jqdialog {
    display: none;
    float: left;
    font-size: 13px;
    height: 100px;
    left: 40% !important;
    overflow: hidden;
    position: fixed;
    top: 30% !important;
    z-index: 200;
}
于 2013-05-02T11:48:14.780 回答