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

editor.js function setProperty test for equality oldValue value #256

Closed
hvierendeels opened this issue Aug 20, 2012 · 1 comment · Fixed by #423
Closed

editor.js function setProperty test for equality oldValue value #256

hvierendeels opened this issue Aug 20, 2012 · 1 comment · Fixed by #423

Comments

@hvierendeels
Copy link

test does not work if oldValue and value are objects {}
so, for the moment i resolved it, by following changes

function setProperty(grid, cellElement, oldValue, value){
// Updates dirty hash and fires dgrid-datachange event for a changed value.
var cell, row, column;
// test whether old and new values are inequal, with coercion (e.g. for Dates)
var equalTest;
if( (typeof oldValue=='object') && (typeof value=='object') )
{
//as Date also qualifies as object, you have to retest
if(oldValue instanceof Date)
{
equalTest=(oldValue >= value && oldValue <= value);
}
else equalTest=(oldValue == value);
}
else equalTest=(oldValue >= value && oldValue <= value);//tshvr4 this test does not work for objects!!!
//tshvr4 if(!(oldValue >= value && oldValue <= value)){
if(!equalTest){
.....

@ghost
Copy link

ghost commented Feb 12, 2013

This should be resolved by the referencing pull request.

@ghost ghost closed this as completed Feb 12, 2013
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant