Disable cell value conditionally for custom editor cell

Posted by: rizwan on 18 February 2020, 1:18 am EST

  • Posted 18 February 2020, 1:18 am EST

    i am using wijmo enterprise version and i am trying to disable custom editor date type cell in beginningedit event by setting ```

    e.cancel = true

    
    https://www.grapecity.com/wijmo/demos/Grid/CustomCells/CustomEditors/angular
    
    i am following above example. Please suggest how to disable custom editor cells.
  • Posted 18 February 2020, 7:18 pm EST

    Hi Rizwan,

    You can disable the editing by adding the following check in the beginningEdit event of CustomGridEditor:

    _beginningEdit(grid: wjcGrid.FlexGrid, args: wjcGrid.CellRangeEventArgs) {
    
            if(args.cancel) {
                return;
            }
    ....
    }
    

    But this workaround can only be used if you have added the beginningEdit event before adding the CustomGridEditor. I have asked the dev team on whether they can provide another workaround. The internal tracking id of the case is 421641.

    Regards,

    Ashwin

    custom editor.zip

  • Posted 18 February 2020, 7:46 pm EST

    Hi Ashwin,

    I have tried what you suggested, added the beginningEdit event before adding the CustomGridEditor column but its still opening. Though it works when i set e.cancel in my own beginningEdit handler too. Waiting for other workaround. Please update me on that as soon as its done. Thanks for your help. :slight_smile:

  • Posted 19 February 2020, 2:11 pm EST

    Hi Rizwan,

    I will update you as soon as I will hear from the dev team.

    ~regards

  • Posted 19 February 2020, 2:14 pm EST

    Hi Rizwan,

    I will update you as soon as I will hear from the dev team.

    Regarding your own beginningEdit event, you need to set e.cancel to true in your own beginningEdit event because that’s how the CustomGridEditor class will know that it needs to cancel the creation of the custom editor.

    ~regards

  • Posted 26 February 2020, 6:12 pm EST

    Hi Rizwan,

    The dev team has provided a workaround using the selectionChanged event. In the selectionChanged event, if you wish to prevent the editing in the currently selected cell, then set that particular column as read-only. And, if the cell can be edited, then set that column back to editable again.

    You can use the isReadOnly property to change the read-only status of the Column.

    ~regards

Need extra support?

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

Learn More

Forum Channels