Skip to content

Instantly share code, notes, and snippets.

@ujnak
Last active December 13, 2022 04:44
対話グリッドの計算
function(options){
options.defaultGridColumnOptions = {
dependsOn: ['PRICE', 'QUANTITY'],
calcValue: function(argsArray, model, record){
const price = parseInt(model.getValue(record, 'PRICE').replaceAll(",","") || 0);
const quantity = parseInt(model.getValue(record, 'QUANTITY').replaceAll(",","") || 0);
if(isNaN(price) || isNaN(quantity)){
return 'error';
} else {
return price * quantity;
}
}
};
return options;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment