Coloured toggle button in a datatable

Hi webix team, I need something advice for the following problem of a toggle button in a datatable. See http://webix.com/snippet/aa6e9572 - first, I want the color of the button in red or green and not in blue. Second, the color of the cell in row 2 and 3 changes, the color of the cell 1 don’t change the color.
Thanks for your advice.

Hi,

you can overwrite the CSS-style for the toggle button:

http://webix.com/snippet/d2282efe

And if you really need to change the toggle value and the cell CSS by clicking the row, here’s an example:

http://webix.com/snippet/5525523f

Hi Listopad,
a lot of thanks, great solution,
best regards
Rainer

Very complex. More simple is use stylized checkbox.

I’ve a problem in the snipped http://webix.com/snippet/720fb597 - In line 112 the movie data are read program defined. In line 116 I read the data with AJAX. The data are the same. But when I change the statement in line 100 from readData() to readData2() the errror: TypeError: t is undefined occured.
Thanks for advice

It is a bug in the library, we will fix it in the next update.
For now, please update code like next

  activeContent:{
    toggleButton:{
      view:"toggle",

Need to be changed like

  activeContent:{
    toggleButton:{
      earlyInit:true, // <= this line added!
      view:"toggle",

http://webix.com/snippet/244db9fe

Hi maksim, a lot of thanks, now it works perfect