Using javascript to change a specific cell's background but multiple cells are being affected

Hi,
I’m using this code to set a cell’s background color:
let style = xs.sheet.data.getCellStyle(2,2)
style.bgcolor = “red”
However multiple cells are being affected and also the change is not instant, I still have to click a cell for the change to take effect.
Is there a proper way to change a cell’s background using javascript code?
highlight cell aspose gridjs.zip (2.2 MB)

Attaching a recording.

@abdelaspose
the style is shared.
xs.sheet.data.getCell(2,2).style you may find the same style id as xs.sheet.data.getCell(7,2).style
currently we haven’t provide setstyle API.
maybe here is a temp workaround:
for example ,you want to change cell at 7,2

//change select area to target
 xs.sheet.data.selector.ri=7;
 xs.sheet.data.selector.ci=2;
xs.sheet.data.selector.range.sri=7;
xs.sheet.data.selector.range.sci=2;
xs.sheet.data.selector.range.eri=7;
xs.sheet.data.selector.range.eci=2;
xs.sheet.data.setSelectedCellAttr('bgcolor','green');

here is the documnet guide for GridJs client js:
https://docs.aspose.com/cells/net/aspose-cells-gridjs/how-to-use-gridjs-client-api/

1 Like

@abdelaspose
We have opened the following new ticket(s) in our internal issue for this request
and we will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CELLSGRIDJS-1751

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

The issues you have found earlier (filed as CELLSGRIDJS-1751) have been fixed in this update. This message was posted using Bugs notification tool by leoluo