I have an edit template for a column that is wider than the display template. I would like to change the Colin widths when the user enters edit mode so the content is not cut off then switch it back when they are done editing. What would be the best way to do that?
Hi Jagadesh,
Let me take a second shot at explaining.
I'm using the edit property of e-column to change the edit template when the user edits the row.
The problem is that what is displayed is a very narrow column, but when I edit I need much more space, so I need to expand the size of the column when the user enters edit while shrinking other columns.
Then when the user exits edit mode I need to change the column widths back.
I think that if you can tell me how to change the column widths that should be enough and I know what events to modify them on.
The issue is that I need the view width to be smaller if I have it set to the same width needed for the edit column it would be too big.
Is there a way to dynamically resize the column on edit itself?
|
App.component.html
<div class="col-lg-8 control-section">
<ejs-treegrid
#treegrid
(actionBegin)="actionBegin($event)"
(actionComplete)="actionComplete($event)"
>
<e-columns>
<e-column
….
</ejs-treegrid>
</div>
App.component.ts
actionBegin(args) {
if (args.type == 'edit') {
var col = this.treegrid.columns;
for (var i = 0; i < col.length; i++) {
if (args.columnName == col[i].field) {
col[i].width = '300px';
this.treegrid.refreshColumns();
}
}
}
}
actionComplete(args) {
if (args.type == 'save') {
var col = this.treegrid.columns;
for (var i = 0; i < col.length; i++) {
if (args.column.field == col[i].field) {
col[i].width = '50px';
this.treegrid.refreshColumns();
}
}
}
|
Thank you for the help. This was exactly what I needed!