SpreadSheet: Format an entire column

Hi,

How, via code, to apply a format to an entire column?
for example [<0]-0.0000;[>=0]0.0000

I also see in this snippet https://snippet.webix.com/zqkbhjd8 that the data object contains undocumented tables: “conditions”, “formats”, etc. If I insert my format in the “formats” table, I don’t see which css identifier to use to recover this format.

I can use the $$("s1").setFormat(i,j,"[<0]-0.0000;[>=0]0.0000") method; but on sheets containing thousands of lines, I will have to make a loop that will consume many resources.

Thank you

Olivier

Translated with DeepL Translate: The world's most accurate translator

Hi Olivier,

Unfortunately, there was a regression in Webix 5.4 and you cannot set formats in data for now. We will fix it in the next update.

For now you can set formats via the spreadsheet.setFormat() function only. It will not consume much resources provided that you refresh Spreadsheet just once after the loop is over.

https://snippet.webix.com/aaedgkkh

As to the formats set in the data set, the relation is as follows:

  • you set format name and value in “formats”
  • you add in to a css string into any style into the appropriate position
  • then you define this style to the necessary data cell
var data = {
  "styles":[
     ["style1",";;;;;;;;;;;format1;;;;"]
   ],
   "data":[
      [1,1,1234,"style1"],
   ],
  "formats":[
      ["format1","[GREEN]0.00;[RED]0.00"]
   ]
};

As I’ve stated before, currently this functionality is broken, but the fix will be soon available.

ok, thank you very much Helga!