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
590
Issue in CellUpdating event of Template Column
posted

Hi

I want some clarification on the new IgrGrid https://es.infragistics.com/products/ignite-ui-react/react/components/grids/data-grid/column-types

I am using template column type in the above example and its provides one property called cellUpdating. So this property will be initiated all the time when we perform any action (hovering on the row of the grid). We only wanted to call this property when data of the grid is being updated. 


By using this code given below you will encountered how many times the method is being executed in the above example. 

const onAddressCellUpdating = (s: any, e: any) => {
    console.log('onAddressCellUpdating')
  }
 <IgrTemplateColumn field="Address" cellUpdating={onAddressCellUpdating} headerText="Address"  />

Please refer all the above mentioned points and suggest the approach to achieve the same point wise.

Best Regards
Shubham

Parents
No Data
Reply
  • 34790
    Offline posted

    Hello Shubham,

    The cellUpdating event on the IgrTemplateColumn will fire whenever the grid is re-rendered, which may be a bit counterintuitive by the name of the event, but this is the case. The grid will re-render as the mouse moves, and this allows the ability to catch template changes if you want to change things when the cell/row is hovered over.

    Unfortunately, I don’t really have an approach to prevent the event from firing and have it only fire when the cell updates. Perhaps something you could do is have a check in the cellUpdating event handler that checks for whether or not the cell has updated? You could utilize the cellValueChanging event of the IgrDataGrid to track when particular cell updates happen.

    If you would like to see an event exposed that only fires for the IgrTemplateColumn that only fires when the underlying item changes or a way to control how frequently the event fires, I would recommend suggesting a new feature request for this. You can suggest this feature request here: https://github.com/igniteui/igniteui-react/issues. This will place you in direct communication with our product management teams who plan and prioritize upcoming features and development based on community and user feedback.

    Please let me know if you have any other questions or concerns on this matter.

Children
No Data