Prevent creation of new row when clicking on certain cells in FlexGrid

Posted by: kamil.zainal.abidin on 5 August 2020, 2:31 am EST

    • Post Options:
    • Link

    Posted 5 August 2020, 2:31 am EST

    Hi,

    For FlexGrid, the default behaviour when clicking any cell in a new row template is to create a new row in an editing state on the selected cell. What I’m looking to do is to disable the creation of a new row when clicking on certain cells in the new row template (using Angular 9, Wijmo Angular 5.20193.637). The reason I would want to do this is because we want to reserve the right-most cells in the grid to be used for buttons, so want it hidden (e.g. a ‘delete’ button doesn’t make sense on a new row).

    I’ve tried intercepting the rowAdded event on FlexGrid, but cancelling the event at this point causes the new row to appear before quickly disappearing. Is there an earlier event I can access, or perhaps another way to ‘disable’ a cell in the new row template?

    Many thanks

  • Posted 5 August 2020, 7:40 pm EST

    Hi Kamil,

    If you only have buttons in that particular column, then there is no need to edit them. Simply set the isReadOnly property of that column to true and a new row will not be added when you will click on the new row template.

    <wj-flex-grid-column [header]="'Buttons'" [isReadOnly]="true"></wj-flex-grid-column>
    

    Regards,

    Ashwin

  • Posted 6 August 2020, 1:11 am EST

    Great! A simple answer is always the best. Thanks for your help with this.

Need extra support?

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

Learn More

Forum Channels