Sherzod Posted June 9, 2020 Share Posted June 9, 2020 Hello! Simple implementation... UniDBGrid.ClientEvents.ExtEvents -> 1. function beforeedit(editor, context, eOpts) { editor.grid.needToClear ? context.value = "" : {}; } 2. function beforeitemkeydown(sender, record, item, index, e, eOpts) { var me=sender.grid; me.needToClear = (e.getKey() !== 13 && e.getKey() !== 9); } 3. function beforeitemkeypress(sender, record, item, index, e, eOpts) { var me=sender.grid; if (!me.editingPlugin.editing) { me.editingPlugin.startEditByPosition({ column: me.uniCol, row: me.uniRow }) } } 1 Link to comment Share on other sites More sharing options...
asapltda Posted June 11, 2020 Share Posted June 11, 2020 Good morning, Thanks for your AutoEdit example, it is possible that you put the same example but with a legacy dbgrid, because with the provided example, it would be necessary to change many dbgrid and additionally be modifying it manually every time a new dbgrid is placed in a Form? The same would apply to an example that you kindly made available to everyone, such as the automatic filters in the dbgrid with the content of the columns. Thanks for your attention Link to comment Share on other sites More sharing options...
Alf Posted June 14, 2020 Share Posted June 14, 2020 I tried it and doesn't work. I had to press enter to activate edition. What I understand and what personally need is that the control enters in edition mode by pressing any key and by the way when focus to the next element it will be the next NOT READONLY element to do a correct edition or append flow. For intensive data manipulation this is a MUST. I cannot beleive that something that simple is not developed for this components. Link to comment Share on other sites More sharing options...
Sherzod Posted June 14, 2020 Author Share Posted June 14, 2020 6 hours ago, Alf said: I tried it and doesn't work. I had to press enter to activate edition. What I understand and what personally need is that the control enters in edition mode by pressing any key and by the way when focus to the next element it will be the next NOT READONLY element to do a correct edition or append flow. For intensive data manipulation this is a MUST. I cannot beleive that something that simple is not developed for this components. Please make a simple testcase. I will check why it does not work for you. Link to comment Share on other sites More sharing options...
Alf Posted June 14, 2020 Share Posted June 14, 2020 Test Case uniGUITestCase.rar Link to comment Share on other sites More sharing options...
Sherzod Posted June 14, 2020 Author Share Posted June 14, 2020 18 minutes ago, Alf said: Test Case uniGUITestCase.rar OK, you are using locked columns. I will check. Link to comment Share on other sites More sharing options...
Sherzod Posted June 15, 2020 Author Share Posted June 15, 2020 13 hours ago, Alf said: Test Case uniGUITestCase.rar Hi, Can you check if this approach works for you (just for test)? 1. Delete all previous JS codes..! 2. function beforeedit(editor, context, eOpts) { this.needToClear == true ? context.value = "" : {}; } 3. function cellkeydown(sender, td, cellIndex, record, tr, rowIndex, e, eOpts) { sender.ownerGrid.needToClear = (e.getKey() !== 13 && e.getKey() !== 9); if (e.getKey() !== 37 && e.getKey() !== 38 && e.getKey() !== 39 && e.getKey() !== 40) { var locked = sender.ownerCt.isLocked; var lockedColLength = sender.ownerGrid.lockedGrid.columnManager.columns.length; var colIndx = !locked ? cellIndex + lockedColLength : cellIndex; sender.ownerGrid.editingPlugin.startEdit(record, colIndx); } } Link to comment Share on other sites More sharing options...
Alf Posted June 15, 2020 Share Posted June 15, 2020 Hi Sherzod, can you please explain a little bit the code? My comments: - If you are positioned on a cell and type anything it will go to edit mode. This is what is needed of course but after you do that anytime you double click on a cell to edit it, the content is erased from the cell. In case you click in another cell you will get the exception in the image and it shows like the cell is not empty but at data level it is false. What is the function of needToClear ??? Maybe this is the reason for this behavoir Wen you use the arrows keys to move in a row of the same column the columns lost the focus after an edition. It should be great if in a middle of an edition you could use the arrows instead of clicking. Now you can't. How can I just press a button and put the cell in edit mode? Of course the active record? Thanks... Link to comment Share on other sites More sharing options...
Sherzod Posted June 15, 2020 Author Share Posted June 15, 2020 2 hours ago, Alf said: This is what is needed of course but after you do that anytime you double click on a cell to edit it, the content is erased from the cell. In case you click in another cell you will get the exception in the image and it shows like the cell is not empty but at data level it is false. What is the function of needToClear ??? Maybe this is the reason for this behavoir Hi, I will check it. Link to comment Share on other sites More sharing options...
Sherzod Posted June 15, 2020 Author Share Posted June 15, 2020 2 hours ago, Alf said: How can I just press a button and put the cell in edit mode? Of course the active record? I will analyze. Link to comment Share on other sites More sharing options...
Sherzod Posted June 16, 2020 Author Share Posted June 16, 2020 2 hours ago, Alf said: In case you click in another cell you will get the exception in the image and it shows like the cell is not empty but at data level it is false. What is the function of needToClear ??? Maybe this is the reason for this behavoir Yes, please add this JS event too: function edit(editor, context, eOpts) { this.needToClear = false; } Link to comment Share on other sites More sharing options...
Alf Posted June 16, 2020 Share Posted June 16, 2020 Now works better but anyway after a post to the database the focus to the column is lost. What is the meaning of needtoClear? Where can I find info about those properties? What you wanted to do with the first method was to make the text selected when you start editing? I sent you the contact by PM if u want to do the team session. Thanks in advance, Link to comment Share on other sites More sharing options...
Sherzod Posted June 16, 2020 Author Share Posted June 16, 2020 35 minutes ago, Alf said: What is the meaning of needtoClear? This is our custom variable, on which we assign and check whether to clear the context or not. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now