Title: The value in the onCellEdit event is always undefined Post by: officecode on January 09, 2019, 10:59:03 PM I am trying 'cellediting' and want to implement the navigation effects of up, down, left and right in the onCellEdit event.
The problem is that the value here is always undefined. I have found similar problems in the forum, but the sample files can't be opened. Can you help me with an example or sample code? Thank you! Title: Re: The value in the onCellEdit event is always undefined Post by: stworthy on January 10, 2019, 02:13:18 AM The 'value' parameter value is only available when calling 'editCell' method and pass the 'value' parameter.
Code: $('#dg').datagrid('editCell', { Title: Re: The value in the onCellEdit event is always undefined Post by: officecode on January 10, 2019, 06:32:49 AM I still don't quite understand. Even if the editCell method is executed, the value in the onCellEdit event is still undefined.
For example, if I press the Enter key in the cell, how can I get the char code: Code: $('#dg').datagrid({ Title: Re: The value in the onCellEdit event is always undefined Post by: stworthy on January 10, 2019, 06:31:58 PM Please look at this example http://code.reloado.com/ocoviy4/edit#preview
Click on the button to edit a cell with a updated value and you will get the 'value' parameter. Click or press ENTER on the datagrid cells to edit a cell, the 'value' parameter lost but you can get the current cell value by this code: Code: var fieldValue = $(this).datagrid('getRows')[index][field]; Title: Re: The value in the onCellEdit event is always undefined Post by: officecode on January 10, 2019, 07:34:26 PM Ok, I see. I originally thought that the key code of the input can be obtained here by the value parameter. It seems that I still have to deal with the input keydown, I hope to press the Enter key to automatically navigate to other cells.
thank you for your help! |