Sherzod Posted June 9, 2020 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 Quote
asapltda Posted June 11, 2020 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 Quote
Alf Posted June 14, 2020 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. Quote
Sherzod Posted June 14, 2020 Author 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. Quote
Sherzod Posted June 14, 2020 Author Posted June 14, 2020 18 minutes ago, Alf said: Test Case uniGUITestCase.rar OK, you are using locked columns. I will check. Quote
Sherzod Posted June 15, 2020 Author 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); } } Quote
Alf Posted June 15, 2020 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... Quote
Sherzod Posted June 15, 2020 Author 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. Quote
Sherzod Posted June 15, 2020 Author 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. Quote
Sherzod Posted June 16, 2020 Author 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; } Quote
Alf Posted June 16, 2020 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, Quote
Sherzod Posted June 16, 2020 Author 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.