---
title: "datagrid样式"
author: "chokee"
date: "2014-06-01T16:24:20Z"
tags: []
categories: ["编程语言"]
slug: "datagrid"
draft: false
lastmod: "2016-07-28T11:28:11Z"
id: 2074615
url: "https://chokee.iteye.com/blog/2074615"
---

/* 设置数据行高 */
 .datagrid-row {
   height: 35px;
 }
 /* 设置数据字体 */
 .datagrid-cell {
   font-size:20px;
 }
 /* 设置列名称字体 */
 .datagrid-header .datagrid-cell span{
  font-size:20px;
  line-height:35px;
 }
 /* 设置列名称行高 */
 .datagrid-header .datagrid-cell {
  height:35px;
 } 

列样式

				onLoadSuccess : function(data) {
					var panel = $(this).datagrid('getPanel');
					// var tr = panel.find('div.datagrid-header tr');
					var tr = panel.find('div.datagrid-body tr');
					tr.each(function() {
								var td = $(this).children('td');
								td.children("div").css({
											"color" : 'blue'
										});
							});
				}

单元格样式
styler : function(value, row, index) {
								if (value == '是') {

									// 当单元格的值小于20的时候，颜色变成红色
									return 'background-color:#ffee00;color:blue;';
								}
							}