USEGEAR

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

学习unigui【23】uniDBGrid的使用摘要

复制代码
Unidbgrid自动调整列宽

UniDBGrid1 -> ClientEvents -> ExtEvents [Ext.data.Store[store] ] add store.load fn:

function store.load(sender, records, successful, eOpts)
{
  sender.grid.columnManager.columns.forEach(function(col){col.autoSize()})
}

UniDBGrid1.ForceFit:=True;//自适应宽度
复制代码
复制代码
在ServerModule模块中找到customcss进行编辑方式,将下面的代码加入到编辑框中去。自定义dbgrid格式

<style type="text/css"> /* unidbgrid */ /* ====================== */ /* 设置表头的样式 */ .x-column-header, .x-column-header-over { background-color:#F3E0C1 /* #e8eff4; 表头背景色 */ color: #333; /* 表头文字颜色 */ font-weight: bold; /* 字体加粗 */ text-align: center; /* 文字居中 */ /* border-bottom: 2px solid #d0d0d0; 表头底部边框线 */ font-size:11px !important } .x-grid-item { font-size:11px !important } /* 为表格行添加斑马条纹背景================================== */ .x-grid-item:nth-child(odd) .x-grid-cell { background-color: #F2F2F2; /* #F6F6F6;浅灰色背景 */ font-size:11px !important ; } .x-grid-item:nth-child(even) .x-grid-cell { background-color: #ffffff; /* 白色背景 */ font-size:11px !important ; } .x-grid-cell { padding: 0px; /* 内边距设置为0px */ white-space: normal; /* 允许自动换行 */ word-wrap: break-word; vertical-align: middle; } /* 长单词或URL可被拆分换行 height: 100%; align-items: center !important; */ .x-grid-cell-inner { padding: 0px; /* 内边距设置为8px */ line-height: 1.8; /* 行高设为1.5倍的字体大小 */ align-items: center !important; } /* 表格行选中样式 */ .x-grid-item-selected .x-grid-cell{ background-color:#FFDDDD !important;; vertical-align: middle; } /* 表格行选中样式 */ .x-grid-item-selected .x-grid-cell-inner { font-weight: bold !important; background-color:#FFDDDD !important;; } /* 鼠标悬停行样式 */ .x-grid-row:hover { background-color: #f1f1f1; } .x-grid-item-focused .x-grid-cell-inner:before { border: none !important; line-height: 1.8; /* 行高设为1.5倍的字体大小 */ } </style>
复制代码

 

posted on   USEGEAR  阅读(424)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
点击右上角即可分享
微信分享提示