Spreadsheet: lock cells on initialization

Is there a way to lock cells when initializing the spreadsheet? I would prefer to do that than having to execute some API code to lock the cells after everything has loaded.

Tagged:

Comments

  • Hello, @mtsrfndave

    To lock cells in the spreadsheet is possible with lockCell method.

    The most suitable event reflecting the general "readiness" of the component is onAfterLoad. It fires after data loading is complete, but not after rendering specifically.
    Here is the snippet https://snippet.webix.com/p7m88lvf

    If for some specific reason you need to lock cells during the initial rendering, you could proceed as follows:
    - first via $$ get subview of cells ($$("ss").$$("cells"))
    - then use onAfterRender to catch the rendering moment and apply lockCell.

    Please, pay attention, that lockCell calls a datateble refresh, onAfterRender, in turn, is triggered for every update. That means that it's possible to get into an endless loop. To avoid this loop, you could use once. Please, check the snippet here: https://snippet.webix.com/tlo15mnu . Also, it's possible to block and then unblock events. Here is the snippet: https://snippet.webix.com/gfi5pt5t

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion