Skip to content
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

onChange not working now on Mac with Safari version 5.1.7 #14

Closed
harrygates opened this issue Jun 6, 2012 · 5 comments
Closed

onChange not working now on Mac with Safari version 5.1.7 #14

harrygates opened this issue Jun 6, 2012 · 5 comments

Comments

@harrygates
Copy link

The latest updates seem to have broken onChange, as it is not firing at all.

@warpech
Copy link
Member

warpech commented Jun 6, 2012

Can you reproduce it with current online "Save" example? http://warpech.github.com/jquery-handsontable/#example6
If yes, maybe could you test some recent revisions to see which revision breaks it?

I don't have access to a real Mac now. I have tested it with Windows Safari 5.1.7 and VirtualBox Mac Safari 5.1.3 and it seems to work ok.

@harrygates
Copy link
Author

I can't reproduce it with the current online "Save" example. The version from May 24th is the previous one I downloaded. It works fine.

Please find below my code. The alert in onChange is not displaying.

var container = $('#dataTable');
container.handsontable({
rows: 50,
cols: 50,
legend: [
/* Legend 1: make read-only /
{
match: function (row, col, data) {
return (row <= 2 || col < 2);
},
style: {
color: '#666',
fontWeight: 'bold'
},
title: 'not editable',
readOnly: true
},
/
Legend 2: format negative numbers */
{
match: function (row, col, data) {
if (parseInt(data()[row][col], 10) < 0) { //if row contains negative number
container.handsontable('getCell', row, col).className = 'negative'; //add class "negative"
} else {
container.handsontable('getCell', row, col).className = '';
}
}
}
],
onBeforeChange: function (data) {
for(var i = 0, ilen = data.length; i < ilen; i++) {
var value = data[i][3];
if(isNaN(value)) {
data[i][3] = false;
alert('Only numbers are allowed. No text.');
}
}
},
onChange: function (data) {
if (first) {
first = false;
return;
}
alert(JSON.stringify(data));
if(data[0][2] != data[0][3]) {
var temp = [data[0][0], data[0][1], data[0][3]];
}
}
});

@warpech
Copy link
Member

warpech commented Jun 6, 2012

I tested your code and you were right that it doesn't work. It was not because of Safari but because onChange was not called when contextMenu was not enabled. I just fixed, please check again.

@warpech warpech closed this as completed Jun 6, 2012
@harrygates
Copy link
Author

It's still not working.

@harrygates
Copy link
Author

Just repulled a minute ago and it is working. Thanks, warpech!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants