由於我們網格上的某些原因,行的垂直對齊不在中間。它似乎是頂級的。有什麼具體的事情需要做,以實現垂直對齊?jqGrid行垂直對齊不是中間
這裏的對齊的例子:
我們的電網定義:
$.extend(jQuery.jgrid.defaults, {
url:'NoData.json',
datatype: 'json',
mtype: 'GET',
altRows:true,
//altclass:'zebraOdd',
loadError: function(xhr,st,err) {
handleError(xhr, 'Error loading grid');
},
onPaging: function (b) {
return onPage($(this));
},
beforeRequest: function() {
beforeReq($(this));
},
loadComplete: function() {
loadComp($(this));
},
onSelectRow: function(id){
$(this).resetSelection(); //This prevents the disabling of the row hovering and altclass - http://stackoverflow.com/questions/3916477
},
scrollOffset:0, //No scrollbar
rowNum:15,
shrinkToFit:true,
width:1120,
viewrecords: true ,
height: '360',
hidegrid: false //Don't show the expand/collapse button on the top right
});
$("#grid-pos").jqGrid({
colNames:['Position Account', 'Product Code', 'Product Type','Expiry', 'Put/Call', 'Strike Price', 'Current Long', 'Current Short', 'Held Exercise Requests', 'Held Abandon Requests', 'Last Trade Date/Expiration Date', 'Select Operation'],
colModel :[
{name:'account', index:'account', width:85, sortable:false},
{name:'productCode', index:'productCode', width:85, sortable:false},
{name:'productType', index:'productType', width:85, sortable:false},
{name:'expiry', index:'expiry', width:85, align:'right',stype:'select', sortable:false},
{name:'putCall', index:'putCall', width:85, sortable:false},
{name:'strike', index:'strike', sorttype: 'float', align:'right', width:85, sortable:false},
{name:'long', index:'long', width:85, align:'right', sortable:false},
{name:'short', index:'short', width:85, align:'right', sortable:false},
{name:'exercise', index:'exercise', width:90, align:'right', sortable:false},
{name:'abandon', index:'abandon', width:90, align:'right', sortable:false},
{name:'LTD', index:'LTD', width:110, align:'right', sortable:false},
{index:'operations', width:150, title:false, align: 'center', formatter:opsFormatter, sortable:false}
],
pager: '#div-pos-pager',
caption: 'View Positions'
});
您的問題現在解決了嗎? – Oleg 2010-11-18 20:05:08
是的,謝謝奧列格 – 2010-11-18 20:54:16
我只是好奇。你爲什麼不把我的解決方案標記爲正確答案? – Adrian 2010-11-18 21:25:47