rockccf
Newbie

Posts: 8
Ignorance is bliss.
|
 |
« Reply #2 on: August 27, 2015, 04:57:46 AM » |
|
Hi,
Now the tab works, it will move to next field. However, because I have bind the keydown event to the datagrid as following :
if (e.keyCode == 38) { //key up resetIdleSecondsCounter(); var cell = dgOpts.finder.getTr(dg[0], index-1, 'body', 2).find('td[field="'+field+'"] div.datagrid-cell'); cell.trigger('click'); return false; } if (e.keyCode == 40) { //key down resetIdleSecondsCounter(); var cell = dgOpts.finder.getTr(dg[0], index+1, 'body', 2).find('td[field="'+field+'"] div.datagrid-cell'); cell.trigger('click'); return false; } if (e.keyCode == 13) { // enter resetIdleSecondsCounter(); var cell = dgOpts.finder.getTr(dg[0], index+1, 'body', 2).find('td[field="'+field+'"] div.datagrid-cell'); cell.trigger('click'); return false; }
Enter key works fine, it will jump to same field on the next row, the problem is with up arrow and down arrow key, when I pressed either one of them after I changed the value in vendorVol, it will jump to same field on the next row, but the value that i entered in vendorVol in the previous row is gone. The cell is empty. If you do not change the value in vendorVol and press up/down arrow key, it will be OK, the value will still be there.
onChange: function(newValue, oldValue) { //Always set the maximum value based on newValue that yield can be entered $(edVendorYield.target).numberbox({ validType: ["minValue[0]","maxYieldValue["+newValue+"]"] }).numberbox('textbox').focus(); console.log("newValue = "+newValue); }
By pressing up/down arrow key, I noticed that the newValue will be printed twice, the first being empty and second shows the new value I entered. By pressing enter key, newValue will only show once and it's showing the new value I entered correctly.
What might cause this? Thanks.
|