Denis Kralj
Denis Kralj

Reputation: 633

JQGrid Count rows in a group

I have a JQGrid that displays some data grouped by a certain column. i wish to show the count of rows next to the group name. anyone know how to do this?

Upvotes: 1

Views: 2273

Answers (1)

Chad Ferguson
Chad Ferguson

Reputation: 3091

You can use the GroupText field for indicating the count:

An array that defines the grouping header text for the group level that will be displayed in the grid. By default if defined the value if {0} which means that the group value name will be displayed. It is possible to specify another value {1} which meant the the total count of this group will be displayed too. It is possible to set here any valid html content.

Example:

groupingView: {
     groupField:['GroupField'],
     groupText: ['<b>{0} - {1} Item(s)</b>']
}

Upvotes: 2

Related Questions