CSS are getting removed after afterChange Event

Tags: #<Tag:0x00007efc6dbc5000>

Hi,

I am having four column in my Grid, I have set readOnly for column 0 and 3 (Color is gray). Column 1 and 2 are editable (Color is green).

Requirement: When user will make any changes in column 1 cell then corresponding cell in column 2 should be readonly with Gray color.

I am able to do that but CSS are getting lost for other columns. Please check the below code and let me know how to retain existing css.

http://jsfiddle.net/fdjao2hv/15/

Initial Stage:
image

After changing value: Css are getting lost for other columns

image

Hi @fayejitendra

you do not need the renderer in this case. You can pass all the styling via cells method. Does this demo http://jsfiddle.net/AMBudnik/netzLjh1/ require any changes?

Hi,

I have requirement like : Based on column value new data will be fetched and reassigned to Grid again.’

In this case CSS and readonly fields are getting lost .
Suppose if I am changing value for B2 then C2 will lock. ok
but if i am changing value of B3 then C3 will lock but C2 css is getting lost

http://jsfiddle.net/34yzks7e/

please suggest how to retain state after data changes.

Loading new data

hot.updateSettings({
data: Handsontable.helper.createSpreadsheetData(3, 4)
});

always erase the setDataAtCell and setCellMeta behavior. Handsontable understands that when you change the data it shouldn’t keep the old settings.
The cells are attached to the table and run with each render() so it is called again once you load the data.

If you want to change data with

 hot.updateSettings({
          data: Handsontable.helper.createSpreadsheetData(3, 4)
        });

or hot.loadData(you_data)

and keep the setCellMeta() actions you’d need to attach it once again.