check box checked state issue

I used below code but still i am unable to save the checkbox state when expand and collapse accordion item. Please help

var dynamicHeader = " Include ";
let id= 'accordionitemid';
// global layout events
onClick: {
onAfterExpand: function (id) {
if (id == "accordionitemid") {
$$(id).$view.querySelector(".header-chkbx").checked = isChecked
onAfterCollapse: function (id) {
if (id == "accordionitemid") {
$$(id).$view.querySelector(".header-chkbx").checked = isChecked


                var config = {

                    rows: [{
                        view: "accordionitem",
                        id: 'accordionitemid',

                        header: 'Registration' + dynamicHeader,

                        onClick: {

                            "header-chkbx": function (event, accordionId, elem) {

                                isChecked = elem.checked

                                    webix.message("checkbox clicked");
                                return false;

                        body: registrationUI,


                var view = webix.ui(config);


  • edited September 2018


    Please check the sample:
    In the sample you can see that I wrap the view and events into webix.ui , it helps the widget "to work" correctly. Also you need to declare the variable as
    var isChecked = 0;

  • yes i also added var isChecked = 0; still its not saving the checkbox state as checked when the accordion is expanded or collapsed.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!