當我調整我的網格大小和水平滾動條出現時,我發現爲它創建了一個額外的空間,但我仍然在其他網格列上看到它。我想只在最左邊的列上看到這個滾動條。jqgrid rtl水平滾動條問題
這是我的代碼:
$(function()
{
$("#gridTable").jqGrid(
{
editurl: "clientArray",
direction:"rtl",
datatype: "local",
colNames:['Code1','Code2', 'Code3', 'Code4','Code5','Code6','Code7','Code8','Code9'],
colModel:[
{name:'code1',index:'code1', width:60, sorttype:"int" , editable:true, edittype:'text'},
{name:'code2',index:'code2', width:150, sorttype:"date" , editable:true, edittype:'text'},
{name:'code3',index:'code3', width:150 , editable:true, edittype:'text'},
{name:'code4',index:'code4', width:80, sorttype:"float" , editable:true, edittype:'text'},
{name:'code5',index:'code5', width:80, sorttype:"float" , editable:true, edittype:'text'},
{name:'code6',index:'code6', width:80, sorttype:"float" , editable:true, edittype:'text'},
{name:'code7',index:'code7', width:80, sortable:false , editable:true, edittype:'text'},
{name:'code8',index:'code8', width:80, sorttype:"float" , editable:true, edittype:'text'},
{name:'code9',index:'code9', sorttype:"float" , editable:true, edittype:'text'},
],
height: '120px' ,
scrolling: true,
autowidth: true,
shrinkToFit: false
});
$("#gridTable").closest(".ui-jqgrid-bdiv").css({ 'overflow-y' : 'scroll' });
var mydata = [
{code1:"1",code2:"22",code3:"aaa",code4:"2.00",code5:"25.00",code6:"",code7:"1234",code8:"",code9:""},
{code1:"1",code2:"22",code3:"aaa",code4:"2.00",code5:"25.00",code6:"",code7:"1234",code8:"",code9:""},
{code1:"1",code2:"22",code3:"aaa",code4:"2.00",code5:"25.00",code6:"",code7:"1234",code8:"",code9:""},
{code1:"1",code2:"22",code3:"aaa",code4:"2.00",code5:"25.00",code6:"",code7:"1234",code8:"",code9:""},
{code1:"1",code2:"22",code3:"aaa",code4:"2.00",code5:"25.00",code6:"",code7:"1234",code8:"",code9:""},
{code1:"1",code2:"22",code3:"aaa",code4:"2.00",code5:"25.00",code6:"",code7:"1234",code8:"",code9:""},
{code1:"1",code2:"22",code3:"aaa",code4:"2.00",code5:"25.00",code6:"",code7:"1234",code8:"",code9:""},
];
for(var i=0;i<=mydata.length;i++)
jQuery("#gridTable").jqGrid('addRowData',i+1,mydata[i]);
});
,這是問題的一個畫面:
任何幫助將appritiated,
感謝的提前。
@ user590586:我更新了我的答案。 – Oleg 2011-03-06 17:14:51
我真的很喜歡你的幫助!我會嘗試你的代碼,並讓你知道,如果我明白了什麼是問題..再次感謝! – user590586 2011-03-09 14:17:18
@ Oleg作品完美博士! – 2012-06-08 21:16:47