简体   繁体   English

如何在Webix数据表中强制更新单选按钮

[英]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? 有没有一种方法可以强制对Webix数据表中单选按钮的每次更改进行更新?

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/ https://jsfiddle.net/9covejnt/2/

But I don't have a clue how to do this. 但是我不知道如何执行此操作。

You can use onCheck event to add some reaction for radio input clicking 您可以使用onCheck事件为单选输入单击添加一些反应

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/ https://jsfiddle.net/9covejnt/3/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM