SMART datagrid v.1 > Classes > DataField
Return true if the two values specified by parameter value1, value2 are the same.
It is compared more strictly than sameValues. Please refer to the table below.
Data type | The standard of determining the same value |
---|---|
TEXT | If one side is undefined, the reset should also be undefined. Other cases will compare by equality operator(==). |
NUMBER | If one side is undefined, the reset should also be undefined. If one side is NaN, the reset should also be NaN. Other cases will compare by equality operator(==). |
BOOLEAN | If one side is undefined, the reset should also be undefined. Other cases will compare by equality operator(==). |
DATETIME | If one side is undefined, the reset should also be undefined. If one side is not Date object, the reset should not be Date object either. Other cases will compare by Date.getTime(). |
$('#setValue').click(function () {
var row = grid.focusedDataRow();
if (row >= 0) {
var f = ds.getFieldIndex('quantity');
var newVal = $('#quantity').val();
var orgVal = ds.getValue(r, f);
// Change only if the values are different.
if (!ds.getField(f).equalValues(newVal, orgVal)) {
ds.setValue(row, f, newVal);
}
}
});