Jquery 免费jqgrid寻呼机安装不正确

Jquery 免费jqgrid寻呼机安装不正确,jquery,jquery-ui,jqgrid,free-jqgrid,Jquery,Jquery Ui,Jqgrid,Free Jqgrid,我已经使用免费jqGrid很多年了。奇怪的是,今天我为一位同事设置了一个简单的模板,这只是一个奇怪的问题。寻呼机的渲染高度非常大。我将把我的代码发布到哪里,并看到附加的屏幕截图 <html> <head> <!-- jQuery --> <script src="/media/jui/js/jquery.min.js" type="text/javascript"></script>

我已经使用免费jqGrid很多年了。奇怪的是,今天我为一位同事设置了一个简单的模板,这只是一个奇怪的问题。寻呼机的渲染高度非常大。我将把我的代码发布到哪里,并看到附加的屏幕截图

<html>
    <head>
        <!-- jQuery -->
        <script src="/media/jui/js/jquery.min.js" type="text/javascript"></script>

        <!-- jquery-ui -->
        <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js" type="text/javascript"></script>
        <link rel="stylesheet" type="text/css" media="screen" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" />

        <!-- jqGrid -->
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/free-jqgrid/4.15.3/css/ui.jqgrid.min.css">
        <script src="https://cdnjs.cloudflare.com/ajax/libs/free-jqgrid/4.15.3/jquery.jqgrid.min.js"></script>
    </head>
    <body>
        <!-- this is the HTML element for the grid UI -->
        <div>
            <table id="grid"></table>
        </div>

        <script type="text/javascript">

        /*
         * Everything inside this function is called after page is done loading
         */
        jQuery(function($){

            /*
             * This is how we setup and configure the grid
             * match the ID of the HTML element with CSS style selector
             */
            $('#grid').jqGrid({
                url:'/phpAJAX/Master/master_grid_v1.php',  //url of data script
                width: 500,
                height: 300,
                datatype: 'xml',
                mtype: 'POST',
                postData:{
                    'arg1':'marks_jqgrid_example'  //tells the script it your database
                },
                colNames:[ //number of column names has to match number of colModel fields
                    'id',
                    'String field (field1)',
                    'Integer Field (field2)'
                ],
                colModel:[  //this is the main setup for each field
                    {name: 'id', hidden: true },
                    {name: 'field1', editable: true },
                    {name: 'field2', editable:true }
                ],
                sortname: 'field1', //the name of the sort field
                sortorder: 'asc', //ascending or descending
                caption: 'Flats or Plates Available',
                pager: true,
                gridview: true,
                onSelectRow: function(id){
                    //do something special when you select a row
                    return;
                },
                rowNum: 10,  //how many rows to show
            })

        })

        </script>
    </body>
</html>

/*
*在页面加载完成后,调用此函数中的所有内容
*/
jQuery(函数($){
/*
*这就是我们设置和配置网格的方式
*将HTML元素的ID与CSS样式选择器匹配
*/
$(“#网格”).jqGrid({
url:'/phpAJAX/Master/Master\u grid\u v1.php',//数据脚本的url
宽度:500,
身高:300,
数据类型:“xml”,
mtype:“POST”,
postData:{
'arg1':'marks_jqgrid_example'//告诉脚本将其保存在数据库中
},
colNames:[//列名的数量必须与colModel字段的数量相匹配
“id”,
'字符串字段(字段1)',
'整型字段(字段2)'
],
colModel:[//这是每个字段的主要设置
{name:'id',hidden:true},
{name:'field1',可编辑:true},
{name:'field2',可编辑:true}
],
sortname:'field1',//排序字段的名称
排序器:“asc”,//升序或降序
标题:“可提供扁平件或板材”,
寻呼机:是的,
gridview:没错,
OnSetrow:功能(id){
//选择行时,请执行一些特殊操作
返回;
},
rowNum:10,//要显示多少行
})
})
看起来带有class
ui pg table
的表得到了导致问题的
高度:100%
样式。如果我删除该选项,则寻呼机的高度将恢复到预期的高度


您应该验证文档是否以

<!DOCTYPE html>


元素之前。

您应该验证文档以

<!DOCTYPE html>


元素之前。

文档是否以
开头?您使用的免费jqGrid的哪个版本?您在测试中使用的是哪种web浏览器?您好@Oleg,添加了该功能。新手错误。您是否以
开头文档?您使用的免费jqGrid的哪个版本?您在测试中使用的是哪种web浏览器?您好@Oleg,添加了该功能。新手犯的错误。