-
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
onChange: prevent certain input #8
Comments
I was able to achieve the desired result using the following: onChange: function (data) { |
The latest code changes seems to have broken the "setDataAtCell" method above. The data remains what was entered, even with text. |
You are right gatesh, thanks for noticing. I submitted a fix. Please check again |
Thanks, warpech! Works great now. |
How would I go about allowing only numbers to be input? I tried the following in the onChange event, but I'm not sure how to call the line: "this.editproxy.finishEditing(true);" or if there is maybe a better way.
handsontable is awesome and I'd like to thank you for creating such a lightweight javascript spreadsheet!
onChange: function (data) {
if (first) {
first = false;
return;
}
$("#dataTable-console").text(JSON.stringify(data));
var newValue = data[0][3];
if(isNaN(newValue)) {
alert("only numbers allowed!");
alert(data[0][0] + '\t' + data[0][1] + '\t' + data[0][2]);
this.editproxy.finishEditing(true);
}
}
The text was updated successfully, but these errors were encountered: