Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
30
Limit Grouped Columns to Three Columns
posted

Hello  can you please help me i want to only 3 column grouped by once if try more then 3 column then unboud it...

$("#grdReport").igGrid({
dataSource: gridData,
autoGenerateColumns: false,
width: '100%',
columns: [

{ key: "IncidentId", hidden: true },
{ key: "Policy", dataType: "string", headerText: "Policy" },
{ key: "Division", headerText: "Division", dataType: "string", width: "25%" },
{ key: "Incident", headerText: "Incident",dataType: "string", width: "10%" },
{ key: "EmployeeName", headerText: "Employee", dataType: "string", width: "20%" },
{ key: "IncidentDate", headerText: "Date", width: "10%", dataType: "date", format: "MM/dd/yyyy" },
{ key: "FromDate", hidden: true },
{ key: "ToDate", hidden: true },
{
headerText: "",
key: "Link",
dataType: "string",
width: "10%",
unbound: true,
template: "<button class='btn btn-hre viewIncident' data-id='${IncidentId}'>View</button>"

}

],
features: [
{
name: 'Sorting',
type: "remote",
mode: "single",
sortUrlKey: "sort"

},
{
name: 'Filtering',
mode: "advanced",
type: "local",
filterExprUrlKey: "filter",
filterDialogContainment: "window",
filterDialogFilterDropDownDefaultWidth: 100
},
{
name: 'GroupBy',
type: "local",
initialExpand: false,
defaultSortingDirection: "asc",
persist: false,
columnSettings: [{
columnKey: "Policy",
isGroupBy: true
}
],

groupedColumnsChanged: function (evt, ui) {
if (ui.groupedColumns.length > 3) {
alert("Max. 3 column allowed to group.");


//I WANT TO SOME CODE ON HERE TO REVERT 4TH COLUMN OR REPLACE 3RD COLUMN


return false;
}
}
},
{
name: "Paging",
type: "local",
pageSize: 10,
recordCountKey: "TotalCount",
pageSizeUrlKey: "pageSize",
pageIndexUrlKey: "pageNumber"
},
{ name: 'Selection', multipleSelection: true },
{ name: 'RowSelectors', enableRowNumbering: false },
{ name: 'Hiding' },
{ name: 'Summaries' }
]
});

Thanks in advance..

PANKAJ BAHUKHANDI

Parents Reply Children