- Sat Feb 08, 2020 12:18 pm
#827528
Hi,
I'm using PM 3.2.1 community version.
I would like to put the value of usrname and currentDtTm to the fields located at field 5 and field 6 of the grid gdCtrReg with the following Javascript.
$("#gdCtrReg").onAddRow(function(aNewRow, oGrid, rowIndex){
var usrname = $("#usrname").getValue() ;
var currentDtTm = $("#currentDtTm").getValue() ;
aNewRow[5].setValue(usrname) ;
aNewRow[6].setValue(currentDtTm) ;
}) ;
An interesting outcome is if I put the statement in the order above, the value of usrname can be inserted into field 5 properly but the value currentDtTm cannot be inserted into field 6.
If I swap the two statements, ie in the order
aNewRow[6].setValue(currentDtTm) ;
aNewRow[5].setValue(usrname) ;
the value of currentDtTm can be inserted into field 6 properly but usrname cannot be inserted to field 5.
Grateful if I can be advised what are the problems of my codes.
Many Thanks
cheers,
Karl
I'm using PM 3.2.1 community version.
I would like to put the value of usrname and currentDtTm to the fields located at field 5 and field 6 of the grid gdCtrReg with the following Javascript.
$("#gdCtrReg").onAddRow(function(aNewRow, oGrid, rowIndex){
var usrname = $("#usrname").getValue() ;
var currentDtTm = $("#currentDtTm").getValue() ;
aNewRow[5].setValue(usrname) ;
aNewRow[6].setValue(currentDtTm) ;
}) ;
An interesting outcome is if I put the statement in the order above, the value of usrname can be inserted into field 5 properly but the value currentDtTm cannot be inserted into field 6.
If I swap the two statements, ie in the order
aNewRow[6].setValue(currentDtTm) ;
aNewRow[5].setValue(usrname) ;
the value of currentDtTm can be inserted into field 6 properly but usrname cannot be inserted to field 5.
Grateful if I can be advised what are the problems of my codes.
Many Thanks
cheers,
Karl