Categories | Question details Back To List | ||||||||
dhtmlx grid cell validation - after alert cannot set editable or cannot see cursor I have validation on some cells in a grid which cause an alert to pop up based on certain rules. After the alert pops up, I can get the focus to go back to the cell in question, but I never can get the cursor to blink. I have to hit F2 to get the cursor back, or click on the cell itself. Basically I need to see the cursor blinking in the validated cell AFTER the user chooses OK on the javascript alert popup window. I currently have this code after the javascript alert pops. mygrid.selectCell(rId,columnId,false,true,edit,true); mygrid.editCell(); Which seems to keep the focus on the cell in question. However no matter what cominations I try with the selectCell function, nothing seems to get the cursor or "force edit" the cell. I have read many of the posts on this forum about how to do this, and have tried numerous of these fixes to no avail. I have tried: mygrid.selectCell(rId,columnId,false,true,edit,true); mygrid.selectCell(rId,columnId,false,true,true,true); mygrid.selectCell(rId,columnId,false,true,false,true); mygrid.selectCell(rId,columnId,false,true,true,false); mygrid.selectCell(rId,columnId,true,false,false,true); mygrid.selectCell(rId,columnId,true,false,true,true); etc etc etc etc Thanks for any help with this. Answer posted by Stanislav on Nov 20, 2007 05:45 Not sure about exact reason of problem in your case, but most probably it time concurrency - you are executing editCell command in moment when current cell is not fully closed yet. Please check attached sample, it shows how concurrency can be resolved. Attachments (1)
Answer posted by jdog on Nov 20, 2007 11:17 OK - what you have supplied activates the cell BELOW the one I am validating, after the user presses OK on the alert box, and yes, the cursor is blinking on the below cell. But I need the cell that was validated to have a blinking cursor instead. Answer posted by jdog on Nov 20, 2007 17:22 So I tried this: mygridFC.selectCell((rId-1),(cellInd)); Because the (rID-1) gives me the row I want. It works great! HOWEVER... now when I navigate using my arrow keys, and get a validation alert, after saying OK to the alert, the cell becomes uneditable, and I get an error as follows: Error: 'this.cell' is null or not an object. It pertains to this line in dhtmlxgrid.js: this .cell.className=this.cell.className.replace("editable","");Apparently by selecting the row above, I've messed with the arrow key functionality and now my object doesn't exist. Help? Answer posted by Stanislav on Nov 21, 2007 02:50 Please beware that in attached sample I used mygrid.selectCell(mygrid.getRowIndex(id),ind); Such conversion as ID-1 is not the best way, while it may work in your case, it is logically incorrect. |