Author Topic: Angular-ParamQuery: How to append click event in column custom HTML  (Read 1736 times)

Digitalsoft

  • Pro OEM
  • Newbie
  • *
  • Posts: 49
    • View Profile
Hi,
Requirement: I want to append a edit icon in one of the column in grid.On clicking the icon I need to get the context of the row and show that details in a popover which has a button to update a value(see attachment req.png).I don't want a separate column for this field to edit
Issue: I can able to append edit icon in render function inside column template like this
columnTemplate: {         
            render: function(ui) {
              let rd = ui.rowData, di = ui.dataIndx
              if(di == 'material' && ui.rowIndx > 3) {
                return {text: ui.cellData + ' (TS:' + rd.targetStockDays+')<span class="ui-icon ui-icon-pencil iconedit" (click)="edit()">
                           </span>'}
              }
I just put a console inside edit method to check.But the angular click event method appended in the column template is not calling.
Is there any workaround to achieve this?


paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Angular-ParamQuery: How to append click event in column custom HTML
« Reply #1 on: June 08, 2020, 09:47:02 pm »
Please use postRenderInterval option and postRender callback for attaching any click event listeners to the cells.

Similar example of usage of postRender callback: https://paramquery.com/pro/demos/editing