How to lock a checkbox column

Posted by: tedin_uriburu on 8 November 2019, 12:11 pm EST

  • Posted 8 November 2019, 12:11 pm EST

    I am locking rows depending on a value in every row. I am able to do this by using getRange(..).locked(). It locks text and comboboxes columns but the columns for type CheckBox are not being locked, what should I do to lock them?

    Thanks,
  • Replied 10 November 2019, 7:50 pm EST

    Hi,
    We are sorry, we are unable to replicate the issue at our end with the release v13 version of Spread JS as we protect the sheet.
    Please find the attached sample for reference.

    Regards,
    Manish Gupta

    features_celltype_checkbox_PureJS (2).zip
  • Replied 12 November 2019, 5:25 am EST

    I will take a look and let you know, thanks.
  • Replied 12 November 2019, 5:30 am EST

    Really, using .Locked doesn't work in my case, I will send the code if necessary, but just a question: I am cancelling the edition in EditStarting event, with code below. It works fine (i.e., it cancels edition for rows with isReadOnly = true. But that doesn't work for checkboxes columns, is there a way to cancel click event or something like that to avoid changing the checkbox state?

    _this.sheet.bind(GC.Spread.Sheets.Events.EditStarting, function (sender, args) {
    let item = _this.sheet.getDataItem(args.row);
    args.cancel = item.isReadOnly || _this.columnsInfo[args.col].name == "psStatus";
    });
  • Replied 12 November 2019, 7:10 pm EST

    Hi Fernando,

    Could you please let us know what is the exact issue you are facing with locking cells? It is working fine at our end, please refer to the previously shared sample.
    Also, could you please share a small sample replicating the issue so that we could further investigate it

    Regards
    Sharad
  • Replied 13 November 2019, 12:08 am EST

    It looks like after applying locked to the cell, if I change that using getRange(..).locked doesn't override the previously set value, I changed that and it is working fine, thanks!
Need extra support?

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

Learn More

Forum Channels