Code Monkey home page Code Monkey logo

Comments (5)

warpech avatar warpech commented on May 20, 2024

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.

from handsontable.

harrygates avatar harrygates commented on May 20, 2024

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]];
}
}
});

from handsontable.

warpech avatar warpech commented on May 20, 2024

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.

from handsontable.

harrygates avatar harrygates commented on May 20, 2024

It's still not working.

from handsontable.

harrygates avatar harrygates commented on May 20, 2024

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

from handsontable.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.