您需要像这样为箭头添加自定义渲染器
var myRendererArrow = function (instance, td, row, col, prop, value, cellProperties) {
Handsontable.cellTypes.checkbox.renderer.apply(this, arguments);
$(td).empty().append("<span class='sm-moon delBlue icon-right-arrow-17' data-icon=''>O</span>");
return td;
};
在 afterRender 回调中,您需要添加此代码
afterRender:function(){
$('input[type=checkbox]').uniform();
$('.checkall').on('click', function () {
$(this).closest('table').find('input.htCheckboxRendererInput').prop("checked",this.checked);
$.uniform.update();//update UniformJS
});
//select clicked column
$(".icon-down-arrow-17").on("click",function(){
var col=$(this).closest("th").index();
container.handsontable("selectCell", 0, col, 5, col);
});
//select row only change th for tr and the column on selectCell
$(".icon-right-arrow-17").on("click",function(){
var row=$(this).closest("tr").index();
container.handsontable("selectCell", row, 0, row, 13,false);//false prevent scroll
});
}
如果值已更改,则仅更改背景颜色,您可以在 afterChange 中使用更改对象
$('#example1').handsontable('getInstance').addHook('afterChange', function(changes) {
var ele=this;
$.each(changes, function (index, element) {
if(element[2]!=element[3]){ //if the original value is not equal to the actual
$(ele.getCell(element[0],ele.propToCol(element[1])))
.addClass('changeInput').data("change",true);
}
});
});
http://jsfiddle.net/D4Kx3/10/