grid单元格可垂直居中

DS7_JinGang
ddlucky 2 years ago
parent ae64419adb
commit ead2707c07

@ -19774,17 +19774,19 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, {
if (checkresult.length > 0) {
var store = Ext.data.Store({
var store = Ext.create('Ext.data.Store', {
autoLoad: true,
fields: [{
name: 'errorType', type: "string"
}, {
name: 'resultName', type: "string"
}],
data: this.ruleCheckNameArr_2,
autoLoad: true
data: []
});
var grid = Ext.create('Ext.grid.Panel', {
var rulegrid = Ext.create('Ext.grid.Panel', {
id:"RuleResultGrid",
store: store,
viewConfig: {
enableTextSelection: true, //允许复制数据
@ -19796,8 +19798,8 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, {
dataIndex: 'errorType',
sortable: true,
align: 'center',
renderer: function (value, cellmeta) {
renderer: function (value, meta, record) {
meta.tdCls = 'middle';
if (value == "Error" ) {
return "<img src='../../../../TruckMng/Content/Images/upload-stop.gif' />";
}
@ -19833,7 +19835,7 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, {
modal: 'true',
buttonAlign: "center",
bodyStyle: "padding:0 0 0 0",
items: [grid],
items: [rulegrid],
buttons: [{
text: Zi.LAN.GuanBi, //"关闭",
minWidth: 70,
@ -19843,6 +19845,32 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, {
}]
});
//function setTdCls() {
// var gridJglb = document.getElementById("RuleResultGrid");
// var tables = gridJglb.getElementsByTagName("table");//找到每个表格
// for (var k = 0; k < tables.length; k++) {
// var tableV = tables[k];
// if (tableV.className == "x-grid3-row-table") {
// var trs = tables[k].getElementsByTagName("tr");//找到每个tr
// for (var i = 0; i < trs.length; i++) {
// var tds = trs[i].getElementsByTagName("td");//找到每个TD
// for (var j = 1; j < tds.length; j++) {
// tds[j].style.cssText = "202px;text-align:center;line-height:130px;vertical-align:center;";
// }
// }
// };
// }
//}
//Ext.getCmp("RuleResultGrid").getStore().on('load', setTdCls);//设置表格加载数据完毕后更改表格TD样式为垂直居中
//rulegrid.getStore().on('load', setTdCls );
store.loadData(this.ruleCheckNameArr_2);
//var gridJglb = Ext.getCmp("RuleResultGrid");
//setTdCls();
this.winCheckRuleListShow.show();
} else {

@ -284,4 +284,10 @@
/*货权转移Owenr Ship Tuansfer*/
background-color: #F86868;
}
/*End*/
/*End*/
/*grid单元格内容垂直居中*/
.x-grid-cell.middle {
vertical-align: middle;
}
Loading…
Cancel
Save