Grid webix with url column click



刚刚在webix中创建了一个表,我有一个"TBD"列,我显示一个URL,我的问题是:如何使这个URLhttps://pops.dra.com/TBD.php?jour=$adep&arc=$ads可点击请?

while($row = mysqli_fetch_array($requete, MYSQLI_ASSOC)) {
$row_array['ac'] = $row["TA"];
$row_array['ad'] = $row["day"];
$ad = $row["day"];
$row_array['ads'] = $row["arc"];
$ads = $row["arc"];
$row_array['eob'] = $row["pl"];
$row_array['linkjournal'] = "https://pops.dra.com/TBD.php?jour=$adep&arc=$ads";
array_push($small_film_set2, $row_array);
}
}
$date_update = $small_film_set2[1]['adep'];
?>
var small_film_set2 = <?php echo json_encode($small_film_set2) ?>;
webix.ready(function(){
grid = webix.ui({
container:"testA",
view:"datatable",
columns:[
{ id:"index",   header:"TA", sort:"int"},
{ id:"ac",  header:["CT", {content:"selectFilter"}],width:120,  sort:"string"},
{ id:"ad",  header:["Date",  {content:"textFilter"}] , width:120,   sort:"int"},
{ id:"ads", header:["Arcid", {content:"textFilter"}],   width:100,  sort:"string"},
{ id:"eob", header:["Pl", {content:"textFilter"}],  width:100,  sort:"string"},
{ id:"linkjournal", header:["TBD"],     width:220,  sort:"string"}
//{ id:"ssr",   header:"Nb",    width:100,  sort:"int", header:[ "nb", {content:"summColumn" }] }
],
autoheight:true,
autowidth:true,
data:small_film_set2,
on:{
"data->onStoreUpdated":function(){
this.data.each(function(obj, i){
obj.index = i+1;
})
}
}
});
});

谢谢你的帮助

定义一个列模板,在那里你可以添加html元素,例如:

{ 
id:"linkjournal", header:["TBD"],     
width:220,  sort:"string",
template: obj => `<a href="${obj.linkjournal}">link text</a>`
}

最新更新