求一个Extjs3.0中gridPanel的viewConfig中参数详解,尤其是getRowClass, return的样式是自定义的还是自带 20
求一个Extjs3.0中gridPanel的viewConfig中参数详解,尤其是getRowClass,return的样式是自定义的还是自带的,求详解,最好有图,有码...
求一个Extjs3.0中gridPanel的viewConfig中参数详解,尤其是getRowClass, return的样式是自定义的还是自带的,求详解,最好有图,有码
展开
展开全部
// 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.
根据给定的数据大于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.
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询