iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
I'm attempting to use the following code to enable the enter key to work as a tab to add a new row to the grid:
var ac = grid.getActiveEditCell();
}
If I assign it to OnEditKeyDown, I get an error (see attached). If I assign it to OnKeyDown, I must press the enter key twice to add the row.
Any help would be greatly appreciated.
Andi,
After spending time looking at the documentation for WebGrid on http://support.intersoftpt.com/, I discovered some code to 'Reconfigure the "Enter" key functions on EditMode'. I was able to add the following section and make it work for Adding also. I've attached the code for reference.
Thanks for your help!
Conrad
wgGetRowByElement(destRow).Select();
wgHighlightEditCell(destCell);
Hi Conrad,
Here is the sample code to use Enter key as a Tab key when we are adding a new row in WebGrid. In here, I am still using OnEditKeyDown. Here is the snippet:
function WebGrid1_OnEditKeyDown(controlId) { var WebGrid1 = ISGetObject(controlId); var position = WebGrid1.GetActiveEditCell().cellIndex; if (event.keyCode == 13) { WebGrid1.GetActiveEditCell().ToCellObject().GetRow().GetCells()[position].Se lect(); } return true; }
I hope it helps and please, do not hesitate to ask if you have any other questions. Thank you.
Best Regards,
Andi Santoso
Using the code above, I receive the error message attached.
Thanks,
In your case, it seems that the object is null. Here, I attached a simple running sample that using "Enter" as a "Tab" button in adding new row on WebGrid. Would you kindly try to run my sample and see if the issue is still occurred. My sample is using Northwind Customer database.
I hope it helps and please let me know if the error is still occurred. Thank you.
The first 3 columns seem to work and then I get this message on the 4th column. As I stated earlier, the KeyDown event works if I hit the Enter key twice. Does that offer any clues?
Yes, forgive me for miss that point. The problem is occured because when we try to access to the next new column, there exists a delay. That is why we need to set time out when we try to access it. Using this code should be solved the issue.
setTimeout(function() { GetRow.GetCells()[position].Select(); }, 200)
I hope it helps and please do not hesitate to ask if you have any other questions. Thank you.
Your example works as expected. I've stumbled upon some new information. When I get the null object error message with my code, it references the previous page, not the page containing the control. Does this offer any clues to my problem?
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname