javascript - change cell background using ngHandsOnTable -
i'm able render table cells using nghandsontable. on clicking submit button, want able change background color of particular cell. problem nghandsontable wrapper is, don't have way access 'td' property. (using can modify td.style.background = "yellow" example)
i tried using customrenderer , tried save td object in 2 dimensional array. but, if save td object reference, background property change not work.
i have happened solve problem using afterrender callback. if use td.style.background in call, cells changing background color. not sure if default callbacks overwriting cell background white previously.
in nghandsontable, got hold of hot instance using afterinit callback.
refer comments here: https://github.com/handsontable/handsontable/issues/3206
var afterrender= function (color) { var td = hotinstance.getcell(row, col); td.style.background = color; } var afterinit = function () { hotinstance = this; } $scope.adjsettings = { afterinit: afterinit, afterchange: oncelledit, afterrender: afterrender };
Comments
Post a Comment