|
表格式分页的,谁帮我修改代码看看
<style type="text/css">
.highlight
{
background-color:red;
}
.highlight .x-grid3-col
{
background-image: none;
}
.x-grid3-row-selected .highlight
{
background-color: red;
}
.x-grid3-row-selected .highlight .x-grid3-col
{
background-image: none;
}
</style>
<script type="text/javascript">
var highlightRowsClientID = '<%= highlightRows.ClientID %>';
var gridClientID = '<%= Grid1.ClientID %>';
function highlightRows() {
var highlightRows = X(highlightRowsClientID);
var grid = X(gridClientID);
grid.el.select('.x-grid3-row table.highlight').removeClass('highlight');
Ext.each(highlightRows.getValue().split(','), function (item, index) {
if (item !== '') {
var row = grid.getView().getRow(parseInt(item, 10));
Ext.get(row).first().addClass('highlight');
}
});
}
// 页面第一个加载完毕后执行的函数
function onReady() {
var grid = X(gridClientID);
grid.addListener('viewready', function () {
highlightRows();
});
}
// 页面AJAX回发后执行的函数
function onAjaxReady() {
highlightRows();
}
</script>
protected void Grid1_RowDataBound(object sender, FineUI.GridRowEventArgs e)
{
DataRowView row = e.DataItem as DataRowView;
if (row != null)
{
if (row["qty"] is DBNull)
{
}
else
{
int entrance = Convert.ToInt32(row["qty"]);
if (entrance < 0)
{
highlightRows.Text += e.RowIndex.ToString() + ",";
}
//if (Convert.ToDecimal(row["qty"]) < 0 )
//{
// if (Convert.ToDecimal(row["qty"]) < 0 )
// {
// highlightRows.Text += e.RowIndex.ToString() + ",";
// }
//}
}
}
}
|
|