hedera-web/js/htk/columns/link/index.js

36 lines
570 B
JavaScript
Raw Normal View History

2022-06-06 08:53:59 +00:00
module.exports = new Class({
Extends: Htk.Column
,Tag: 'htk-column-link'
2022-06-06 08:53:59 +00:00
,Properties: {
/**
* The link url.
2022-05-26 06:08:31 +00:00
*/
2022-06-06 08:53:59 +00:00
href:{
type: String
,value: null
},
/**
* the target where the link is opened.
2022-05-26 06:08:31 +00:00
*/
2022-06-06 08:53:59 +00:00
target:{
type: String
,value: null
}
}
2022-05-26 06:08:31 +00:00
,render: function(tr) {
var link = this.createElement('a');
link.href = this.href;
2022-05-26 06:08:31 +00:00
link.appendChild(this.createTextNode(this.value));
if (this.target)
link.target = this.target;
2022-06-06 16:02:17 +00:00
var td = Htk.Column.prototype.render.call(this, tr);
2022-05-26 06:08:31 +00:00
td.appendChild(link);
return td;
}
});