jQuery UI Widgets › Forums › Grid › Alternate row color after grouping in jqxgrid
Tagged: asp .net mvc, html, jQuery, jqxgrid
This topic contains 1 reply, has 2 voices, and was last updated by Hristo 9 years, 5 months ago.
-
Author
-
Hi,
I load same jqxgrid twice in my application. One is during initial page load and other is on button click in that same page. In initial load i have not used grouping and alternate row colors are working fine. During the button click, i call the same jqxgrid with grouping and rowindex gets changed and same colors are getting loaded in consecutive rows. I need to show the row colors alternatively even after grouping. Any help is appreciated. Below is the code which i have used during the button click.$(“#mainData”).jqxGrid(
{
width: ‘99.5%’,
pageable: false,
height: ‘100%’,
rowsheight: 30,
altrows: true,
source: dataAdapter,
groupable: true,
groups: [‘Series’],
showgroupsheader: false,
groupsrenderer: function (defaultText, group, state, params) {
return “<div style=’margin: 5px;’>” + ” + “</div>”;
},
groupsexpandedbydefault: true,
sortable: false,
filterable: true,
filtermode: ‘excel’,
columnsresize: true,
columnsreorder: true,
editable: true,
selectionmode: ‘multiplecellsadvanced’,
columns: [
{ text: ‘Production Resource’, datafield: ‘ProductionResource’, width: ‘8.5%’, editable: false, groupable: false },
{ text: ‘Series’, datafield: ‘Series’, width: ‘8.5%’, editable: true },
{ text: ‘Item Status’, datafield: ‘ItemStatus’, width: ‘8.5%’, editable: false, groupable: false },
{ text: ‘Future Status’, datafield: ‘FutureStatus’, width: ‘6%’, editable: false, groupable: false },
{
text: ‘Adj Prod Qty’, datafield: ‘AdjProdQty’, width: ‘5%’, editable: true, groupable: false,
cellvaluechanging: function (row, datafield, columntype, oldvalue, newvalue) {
}
},
]
});Hello vinu,
You do not need to re-set all settings in the Grid when you clicking overt the button.
If you need to change the color of a grouped column just you could use.jqx-grid-group-column { color: red; }
If this does not help please give me more information what you want to achieve.Best Regards,
Hristo HristovjQWidgets team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.