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.

try way:

var new_number = number(params.newvalue); 

find more topic here.


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -