Greetings!
I must have forgotten something. I have a grid with a txt column.
When the user clicks on a cell in the txt column, a nice text box opens and she can enter/change/delete text.
When she leaves the cell I want to update the DB on the server. But, I can’t seem to get the onEditCell event to fire.
I can get onCellChanged event to work, but due to other issues, I’d prefer to use the onEditCell event.
This is my test code that does not fire.
myAgrid.attachEvent(“onEditCell”, function(stage,rId,cInd,nValue,oValue){
alert("ln2521\nstage: “+stage+” \nrow: “+rId+” \ncell: “+cInd+”\nnValue: “+nValue+”\noValue: "+oValue);
});
What am I missing?
Thanks, great product!
I am using 2.5 Pro Build 91111
Unfortunately the described problem cannot be reproduced locally.
onEditCell event fires well for me.
If the problem still occurs for you please, share with a demo link, or provide with a simple complete demo, where the problem can be reconstructed.
Thank you for the quick response.
I suspect I do not understand what constitutes an edit event.
The grid has a single txt column. The user clicks in a cell in the column and a text box opens.
the user enters text and leaves the cell, the text box closes and the entered text shows in
the cell. I thought that would cause an onEditCell event. Apparently not.
The cell is clearly selected. Do I need to somehow use the editCell() method in order to cause the onEditCell event to fire?
Thanks for you time and help.
Have fun.
Paxton
If you are using your custom editor and a native editor is not used so the onEditCell event won’t occur.
You may try to use the onCellChanged event or call the required logic right in your custom code for the cell edit.
Thank you again for your reply.
As I described in my original post, I do nothing custom, I only define the column as txt and when the user enters the column, the text area opens and text is entered. Maybe I do not understand, maybe this activity is not called an ‘edit’. In any case the user can enter data and it is stored in the cell.
I would expect the onEditCell event to fire somewhere along the way.
As I also stated in my original post, onCellChanged does in fact work, but not a good solution as there are lots of cell changes that are not ‘edits’.
I would like to better understand what causes the onEditCell event to occur.
Have fun,
Paxton
If you do a doubleclick in a txt cell a default editor will open (a textbox). In this case onEditCell should occur.
If it is not working for you please, share with a demo link, or provide with a complete demo, where your mentioned problem can be reconstructed.
Greetings!
Actually, I use a single click…
myAgrid.enableEditEvents(true,false,true);
As I stated, the text box opens fine.
just no onEditCell event firing upon selecting, entering text or leaving the cell.
I will work on constructing a demo. That will probably help me find the issue
Strange onCellChanged works fine.
Have a fun weekend
Paxton
Greetings!
Just to “close the loop” I made a test demo which works.
So, must have a conflict somewhere in my application.
Will start commenting stuff our and see if I can find it.
Paxton