init Multiple Sheets that they have some different configurations

hello,
I have Multiple Sheets, they have some same configurations(such as width/height/toobar:false).
But they also have some different configurations(such as column headers/columnCount/rowCount)
ps: we custom column headers with onColumnInit funciton

how can I do that? thanks so much!

Hi @zzhang

You can update these values on onColumnInit and onAfterSheetShow events

Example: https://snippet.webix.com/zw6lu43w

about onAfterSheetShow in this demo
we will do some operations(such as define rowCount/columnCount, add conditions or set cells style )for each active sheet when trigger the event "onAfterSheetShow ", but I hope only execute once for each sheet rather than execute any time when change the active sheet,how can I do that by a easy way? thanks a lot!

@zzhang

In fact, I would recommend using onBeforeSheetShow event.

I hope only execute once for each sheet rather than execute any time when change the active sheet,how can I do that by a easy way?

Unfortunately, this is not possible because each time we show sheet, the inner table is redrawn and it can’t simultaneously have rowCount 5, 10 and 15.

yes,you are right about rowCount /columnCount.
I shouldn’t take the example with rowCount .
please check https://snippet.webix.com/aurktcyn
there is no need to setStyle() agian when some sheet has been the active sheet for second time. am I right?

@zzhang

Yes, in this case, styles are stored in data. You can check it with spreadsheet.serialize(true).

ok,thank you!
could you please have a check with this problem? It is urgent.

  1. When I want to import ‘@xbs/spreadsheet/spreadsheet.js’ I got the error ”webix is not defined“ . then I add the next section in the webpack.config.js:

plugins: [
new webpack.ProvidePlugin({
// SET PATH TO WEBIX HERE
webix: path.join(__dirname, “node_modules”, “@xbs”, “webix-pro”)
})
],the problem is solved!

2.But now, when I do unit test ,this problem is still happened.
Error1: webix is not defined in …/spreadsheet.js
Error2: node_modules\@xbs\webix-pro\webix.js Can’t locate codebase

By the way, I use react + enzyme + jest.

I have posted it on this link:
https://forum.webix.com/discussion/35526/webix-6-and-importing#latest

@zzhang

Please, check the solution in the following thread.