angularjs - Javascript validation in rows of table -
i working on ag-grid validating row. column name index , here validation function using.
function numbervalidate(params) { var new_number = parsefloat(params.newvalue); if (isnan(new_number)) { window.alert("invalid value " + params.newvalue + ", must number"); } else { params.data.index= new_number; params.api.onnewrows(); } }
if edit row , type value, variable 'new_number value. check if numerical. if not, give window.alert.
if number, update row value.
my problem this--> if mention '56sfdfd', takes 56 , updates in row. however, should display window.alert stating '56sfdfd' not number.
any idea how correct in javascript function above. inputs appreciated.
Comments
Post a Comment