/calcvalue-interactive-grids.js Secret
Last active
December 13, 2022 04:44
対話グリッドの計算
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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