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

How to force the update of radio buttons in Webix datatable

本文关键字:单选按钮 数据表 Webix 何强制 更新      更新时间:2024-04-07

有没有办法强制更新Webix数据表中的单选按钮?

我有一个类似的数据表

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/

但我不知道该怎么做。

您可以使用onCheck事件为点击的无线电输入添加一些反应

类似于下一个

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/