求一个Extjs3.0中gridPanel的viewConfig中参数详解,尤其是getRowClass, return的样式是自定义的还是自带 20

求一个Extjs3.0中gridPanel的viewConfig中参数详解,尤其是getRowClass,return的样式是自定义的还是自带的,求详解,最好有图,有码... 求一个Extjs3.0中gridPanel的viewConfig中参数详解,尤其是getRowClass, return的样式是自定义的还是自带的,求详解,最好有图,有码 展开
 我来答
wanglian_0
2012-04-01 · TA获得超过354个赞
知道小有建树答主
回答量:215
采纳率:0%
帮助的人:150万
展开全部
// Return CSS class to apply to rows depending upon data values
根据给定的数据大于0 小于0,返回的是你自定义的样式
getRowClass: function(record, index) {
var c = record.get('change');
if (c < 0) {
return 'price-fall';
} else if (c > 0) {
return 'price-rise';
}
}
getRowClass( Record record, Number index, Object rowParams, Store store ) : String
Override this function to apply custom CSS classes to rows during rendering. You can also supply custom parameters t...
Override this function to apply custom CSS classes to rows during rendering. You can also supply custom parameters to the row template for the current row to customize how it is rendered using the rowParams parameter. This function should return the CSS class name (or empty string '' for none) that will be added to the row's wrapping div. To apply multiple class names, simply return them space-delimited within the string (e.g., 'my-class another-class'). Example usage:
viewConfig: {
forceFit: true,
showPreview: true, // custom property
enableRowBody: true, // required to create a second, full-width row to show expanded Record data
getRowClass: function(record, rowIndex, rp, ds){ // rp = rowParams
if(this.showPreview){
rp.body = '<p>'+record.data.excerpt+'</p>';
return 'x-grid3-row-expanded';
}
return 'x-grid3-row-collapsed';
}
},
Parameters:

record : Record
The Ext.data.Record corresponding to the current row.
index : Number
The row index.
rowParams : Object
A config object that is passed to the row template during rendering that allows customization of various aspects of a grid row.
If enableRowBody is configured true, then the following properties may be set by this function, and will be used to render a full-width expansion row below each grid row:

body : String
An HTML fragment to be used as the expansion row's body content (defaults to '').
bodyStyle : String
A CSS style specification that will be applied to the expansion row's <tr> element. (defaults to '').
The following property will be passed in, and may be appended to:
tstyle : String
A CSS style specification that willl be applied to the <table> element which encapsulates both the standard grid row, and any expansion row.
store : Store
The Ext.data.Store this grid is bound to
Returns:

String
a CSS class name to add to the row.
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式