当我使用 awe 图标的 fa-plus-square-o 和 fa-minus-square-o 单击图标时,我执行 w2ui 网格的 showColumn()、hideColumn() 的方法,我想显示手风琴。
它是通过以下代码实现的。网格刷新完成后,图标的状态又回到了初始状态,难度很大。
您如何以最简单的方式在网格列标题中显示图标、处理单击事件并重绘它们?
w2ui开发时的版本是1.4.3,但是1.5版本就可以了。
columns: [{
field: 'col02',
caption: ''
+'<div>'
+' <div>'
+' <i class="fa fa-lg text-danger fa-plus-square-o" aria-hidden="true"></i>'
+' </div>'
+' <div>'
+ '<span class="vertical">vert title</span>'
+' </div>'
+'</div>',
size: '70px',
// sortable: true, <- By the way, sorting did not work when picking up a click event
attr: 'align=right',
resizable : true,
render: function(record, index, col_index) {
return (record.col02 == 0 ? '-' : record.col02.toFixed(2));
}