Ad

How To Force The Update Of Radio Buttons In Webix Datatable

Is there a way to force the update for each change of the radio buttons in Webix datatable?

I have a datatable like

var list = [{ 
  id:1, user:"", mail:"", rad:''
}, { 
  id:2, user:"", mail:"", rad:''
}, { 
  id:3, user:"", mail:"", rad:''
}, { 
  id:4, user:"", mail:"", rad:''
}, { 
  id:5, user:"", mail:"", rad:''
}]; 


webix.ui({  
  view:"datatable",
  data:list,
  columns:[{ 
    id:"ra1", header:"", template:"{common.radio()}", width:50
  }, { 
    id:"user",  sort:"string", header:"Name", adjust:true
  }, {
    id:"mail",  editor:"text",      header:"E-mail" , adjust:true
  }]
});

https://jsfiddle.net/9covejnt/2/

But I don't have a clue how to do this.

Ad

Answer

You can use onCheck event to add some reaction for radio input clicking

Something like next

webix.ui({  
  view:"datatable",
  on:{
    onCheck:function(id){
      //do something 
      //next line triggers default data saving logic
      webix.dp(this).save(id);
    }
  }
});

https://jsfiddle.net/9covejnt/3/

Ad
source: stackoverflow.com
Ad