Is it possible to group phpgrid data with more than one field or column ?

QuestionsIs it possible to group phpgrid data with more than one field or column ?
toki asked 11 years ago

Hi Abu,

1. Is it possible to group phpgrid data with more than one field or column ?

e.g. Group phpgrid data with date and customer_id columns(fields)

2. Is it possible to write sum of total near the side of 2013-05-30 – 1 Item(s) in the groupheaders?

regards…

3 Answers
Abu Ghufran answered 11 years ago

It's not fully stable, but you can try following config.

$grid["grouping"] = true;
$grid["groupingView"] = array();

$grid["groupingView"]["groupField"] = array("field1","field2"); // specify column name to group listing
$grid["groupingView"]["groupDataSorted"] = array(true,true); // show sorted data within group
$grid["groupingView"]["groupSummary"] = array(true,true); // work with summaryType, summaryTpl, see column: "total";

$grid["groupingView"]["groupColumnShow"] = array(false,false); // either show grouped column in list or not (default: true)
$grid["groupingView"]["groupText"] = array("<b>{0} – {1} Item(s)</b>"); // {0} is grouped value, {1} is count in group
$grid["groupingView"]["groupOrder"] = array("asc"); // show group in asc or desc order
$grid["groupingView"]["groupCollapse"] = true; // Turn true to show group collapse (default: false)
$grid["groupingView"]["showSummaryOnHide"] = true; // show summary row even if group collapsed (hide)

Refer demos/appearence/grouping.php for more help.

To change label text of header, just like we do in footer-row summary js.

$("#list1").jqGrid('setLabel','<COL-NAME>','<NEW-LABEL>');

maciek answered 11 years ago

is it available in the free version?

Abu Ghufran answered 11 years ago

Most likely, it will work.
I am sending you sample on email.

Your Answer

4 + 11 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?