首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >free-jqgrid寻呼机不能正确安装

free-jqgrid寻呼机不能正确安装
EN

Stack Overflow用户
提问于 2018-02-28 22:10:12
回答 1查看 273关注 0票数 0

我已经使用免费的jqGrid好几年了。奇怪的是,今天我正在为一位同事设置一个简单的模板,这只是一个奇怪的问题。寻呼机是以非常大的高度呈现的。我会将我的代码张贴在哪里,并看到附加的屏幕截图。

代码语言:javascript
复制
<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>

看起来像是包含ui-pg-table类的表得到了一个导致问题的height: 100%样式。如果我去掉它,那么寻呼机的高度就会恢复到预期的高度。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-03-01 21:44:49

您应该验证文档是否以

代码语言:javascript
复制
<!DOCTYPE html>

<html>元素之前。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49031521

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档