ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: youngvan on June 17, 2014, 06:48:23 pm
-
Hey,
Is it possible to make a group by few fields simultaneously?
For example I wanna make group by Country and City.
Country | City | District |
England | London | Greenwich |
England | London | Croydon |
England | London | Bromley |
I've tried to add group index:
groupModel : ['2fieldGroup']
and add dataIndx : "2fieldGroup"
at first column of header.
After this for each row with data I add $row['2fieldGroup'] = "England_London";
It works but in this case Country column shows "England_London" instead of just "England"
Any suggestions?
-
I'm not sure whether I got your question completely but grouping by multiple fields is simple.
groupModel:{
dataIndx: ["Country","City"]
},
Example:
http://paramquery.com/pro/demos/group_rows
-
I saw this option, it's not what I really need.
I'd like to have a possibility to group by just one field but value of this field should consist of two other (Country + City)
Maybe it's possible to set two different values for cell: one for grouping("England_London") and second parameter which should be displayed in table("England"), so "group by" value of cell will be different from "displayed" value in table.
-
view can be different from the data in a cell
use column.render callback
render: function(ui){
return ui.rowData["Country"]+"-"+ui.rowData["City"];
}
API ref:
http://paramquery.com/pro/api#option-column-render