JQgrid第一行高度问题

时间:2013-11-14 13:11:09

标签: jqgrid

为什么我的JQ网格第1行或者我们可以告诉第0行这样增加? 为什么这样..请在下面找到我的代码。

enter image description here

 function bindGrid(jsondata)
 {
jQuery("#list1").jqGrid(
{
    //datatype: "json",
    datatype: "jsonstring",
    datastr: jsondata,
    colNames: ['username', 'email'],
    colModel: [
    {
        name: 'username',
        index: 'username',
        width: 100,
        classes: 'pointer'
    },
    {
        name: 'email',
        index: 'email',
        width: 250,
        classes: 'pointer',
        editable:true,        
        "editrules":{"required":true,"email":true}
    }
    ],
    //rowNum:10000,    
    sortorder: "asc",
    caption: "Email Configuration",
    gridview: true,
    loadui: "block",

    rownumbers: true, //Displays Row number Column                       
    'cellEdit': true,
    'cellsubmit' : 'clientArray'
    ,editurl: 'clientArray'
    ,afterSaveCell: function(rowid, cellname, value, iRow, iCol)
    {debugger;
       var username =$('#list1').jqGrid ('getCell', rowid, 'username');
       var email =value;
       UpdateEmailInDataBase(username,email);
    },
    shrinkToFit:true,
    height: "100%",
    rowNum:10,
    rowList:[5,10,20],
    pager: '#pager',
    ignoreCase:true,
    viewrecords: true        
}).jqGrid('navGrid','#pager',{add:false,edit:false,del:false});

2 个答案:

答案 0 :(得分:1)

可能您将网格放置在float: left float: right CSS样式的某个div中。您可以尝试移动<table id="list1"></table><div id="pager"></div> 临时作为<body>的第一个直接子项来验证这一点。检查(跟踪)第一行的样式(具有太大的高度值)是很好的。可以使用IE的开发者工具(按 F12 启动然后进入查找菜单),Chrome或Firefox来检查应用的CSS样式。

答案 1 :(得分:0)

谢谢奥列格,你的观点对我有所帮助。   问题是身高

<input type="button" value="Load" id="btn" />
<div>
    <table id="list1" height="700px">
    </table>
    <div id="pager">
    </div>
</div>

我删除了高度及其正常工作