how can someone add any custom plugin such as
https://github.com/naresh-n/slickgrid-column-group
in serenity 2.0.
issue #447 has some insight about this subject but it is before the type script is implemented in serenity.
my question is how to do it in type script.
found solution for this.
@section Head {
<link rel="stylesheet" href="~/Scripts/SlickGrid/Plugins/slick.columngroup.css">
<script src="~/Scripts/SlickGrid/Plugins/slick.columngroup.js"></script>
}
declare namespace Slick {
class ColumnGroup {
constructor();
enableColumnGrouping(): void;
disableColumnGrouping(): void;
}
}
interface Column {
asyncPostRender?: Slick.AsyncPostRender;
behavior?: any;
cannotTriggerInsert?: boolean;
cssClass?: string;
defaultSortAsc?: boolean;
editor?: Function;
field: string;
focusable?: boolean;
formatter?: Slick.ColumnFormatter;
headerCssClass?: string;
id?: string;
maxWidth?: any;
minWidth?: number;
name?: string;
rerenderOnResize?: boolean;
resizable?: boolean;
selectable?: boolean;
sortable?: boolean;
toolTip?: string;
width?: number;
format?: (ctx: Slick.FormatterContext) => string;
referencedFields?: string[];
sourceItem?: SyberLib.PropertyItem;
sortOrder?: number;
groupTotalsFormatter?: (p1?: GroupTotals
visible?: boolean;
groupName?: string;
}
var plugin = new Slick.ColumnGroup();
grid.registerPlugin(plugin);
var columns = grid.getColumns();
//grid.registerPlugin(new Slick.columng);
for (let col of columns) {
//console.log(col);
if (col.field == "AccountCode" || col.field == "AccountName") col.groupName = "Account";
if (col.field == "AcOpeningDrAmt" || col.field == "AcOpeningCrAmt") col.groupName = "Opening";
if (col.field == "AcTransactionVoucherDrAmt" || col.field == "AcTransactionVoucherCrAmt") col.groupName = "Transaction";
if (col.field == "CLOSINGBALANCEDR" || col.field == "CLOSINGBALANCECR") col.groupName = "Closing";
}
plugin.enableColumnGrouping();
i would try and post a sample soon.

Although content is right align but the header remains centre align, unable to correct this behavior. can someone help.
Dont modify Serenity code. You can add your changes to interfaces in separate file.
which folder you recommend for keeping this custom code.
what happens to original interface.
Your folders in application, modules etc. Typescript merges interfaces.
thanks for your advice.
i would move the code.
can you please guide me on how to align header text.
done by changing
col.headerCssClass = "align-right";
@mrajalko hey can you help me to add this grouping in the editor please
Most helpful comment
found solution for this.
@section Head {
}
declare namespace Slick {
class ColumnGroup {
constructor();
enableColumnGrouping(): void;
disableColumnGrouping(): void;
}
}
interface Column {, p2?: Column) => string;
asyncPostRender?: Slick.AsyncPostRender;
behavior?: any;
cannotTriggerInsert?: boolean;
cssClass?: string;
defaultSortAsc?: boolean;
editor?: Function;
field: string;
focusable?: boolean;
formatter?: Slick.ColumnFormatter;
headerCssClass?: string;
id?: string;
maxWidth?: any;
minWidth?: number;
name?: string;
rerenderOnResize?: boolean;
resizable?: boolean;
selectable?: boolean;
sortable?: boolean;
toolTip?: string;
width?: number;
format?: (ctx: Slick.FormatterContext) => string;
referencedFields?: string[];
sourceItem?: SyberLib.PropertyItem;
sortOrder?: number;
groupTotalsFormatter?: (p1?: GroupTotals
visible?: boolean;
groupName?: string;
}
var plugin = new Slick.ColumnGroup();
grid.registerPlugin(plugin);
var columns = grid.getColumns();
i would try and post a sample soon.