-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
After change event problems #744
Comments
handsontable is supporting this: 'afterChange': function (changes, source) {
if (!changes) {
return;
}
var instance = /* TODO for $handsontable-instance */;
$.each(changes, function (index, element) {
var change = element;
var oldValue = change[2];
var newValue = change[3];
var rowIndex = change[0];
var columnIndex = change[1];
var cell = instance.getCell(rowIndex, columnIndex);
var foreColor = /* TODO */;
var backgroundColor = /* TODO */;
cell.style.color = foreColor;
cell.style.background = backgroundColor;
});
} |
I tried this one while debugging it is showing the color after that it is showing the previous color |
I can not make it work: http://jsfiddle.net/8hv4z/13/ |
First "problem": your columnIndex does not start with 0, hence Second problem:
The only hook afterwards is |
I have started with |
According to https://github.com/warpech/jquery-handsontable/wiki/Events the signature looks like this:
Here's the workaround: http://jsfiddle.net/8hv4z/15/ But implementing a cache, as in http://jsfiddle.net/8hv4z/17/, makes changes "persistant" |
Thanks @dittodhole. I have made an small modification in order to highlight only the cells if the new value is different than the old one: Thanks again :) |
Do you know if this could be possible using also on the previous version (Handsontable 0.8.23)? I've noticed that I am not yet using the last version because of a problem I found on the v.9. |
Actually ... According the events-docu
vs
but maybe the author knows how to implement the afterRender-event to 0.8 |
i done in this way, thanks for share;
i add |
Here's a shorter version, based on papablopo's version above: Add this code in afterChange handler: Add this code in afterRender handler: Add this css in your stylesheet: |
@pieroweb just what i've implemented months ago :) http://jsfiddle.net/8hv4z/17/ (actually a bit buggy, but ... gives the glimpse of an idea) |
@pieroweb @dittodhole This isn't working as expected after you sort. Any workarounds? |
@udaiarora any (non)working fiddle to play around with? (and to show us some implementation and where exactly your problem resides...) |
I was talking about your fiddle- http://jsfiddle.net/8hv4z/17/ If you sort after change you will see the bug. But that can be fixed using sortIndex. Thanks anyways |
I assume issue can be closed in lack of recent activity. If you would like to talk about your solutions here, we'll reopen the issue. |
Hi
After changing the cell value i need to change the color for that cell and i need to repeat this for more than 10 cells.
But as of now this HandsOnTable is not supporting this feature.
Thanks
GBSSarma
The text was updated successfully, but these errors were encountered: