Custom Editor and Cell Templating

Originally Posted 6 September 2017, 9:02 am EST

  • Originally Posted 6 September 2017, 9:02 am EST


    We are trying to implement Custom cell editor and we found this solution. But we are not able to find equivalent event for beforeCellEdit and afterCellEdit in here.

    We are using Wijmo 5.20172.334 version with Angular 2. Please let me know if i am missing something here.


  • Reply

    Hello Nilesh,
    The solution you referred is for Wijmo 3 gridview widget. The documentation and controls you are using are for Wijmo 5 control.
    You can add custom cell editor using wjFlexGridCellTemplate. For reference, please refer to the following demo sample:

    However, if you would like to add editor using code, you need to create custom editor using formatItem event. For your reference, please refer to the attached sample for the same.

    Manish Kumar Gupta
  • Reply

    Hello Manish,

    Thanks for quick response. We tried both solution with template as well as with code but somehow we are not able to implement it.

    1) We are already currently using <template wjFlexGridCellTemplate> tag instead of <ng-template wjFlexGridCellTemplate> but its not rendering that template

    <ng-template wjFlexGridCellTemplate [cellType]=”‘CellEdit'” *ngIf=”column.type==’STRING_ENUMERATION'” let-cell=”cell” let-item=”item”>
    <wj-combo-box [itemsSource]=”column.enumerationList” [(selectedValue)]=”item[column.binding]” [isEditable]=”false”></wj-combo-box>

    2) Using Code :- In this case we don't know column for custom editor initially as we have dynamic columns so we need to decide using attributes of columns data array which is present in our component but we are not able to access that variable inside initGrid method. I tried passing that variable to initGrid function itself.

    In code below this.columnDefCollection contains the information of column on which i want to have custom editor and also required data for that like options list in case of dropdown.

    initGrid(flex: wjcGrid.FlexGrid, event: wjcCore.EventArgs) {              
    let columnDefCollection = this.getCoolectionData(); // function to get this.columnDefCollection but its giving me empty array.
    console.log("Init Grid called", this.columnDefCollection); // this.columnDefCollection contains the list of column on which i want to apply custom editor but i am getting empty array here as well.

    Please let me know if i am missing something here or how can i pass some extra data to initGrid function.

  • Reply

    Please refer to the following forum post for complete discussion:

    Manish Kumar Gupta
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels