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 use webgrid with layout setting CellClickAction="RowSelect" and clienSideEvent "OnEditKeyDown"
I use down arrow to exit edit and move cursor to the same column next row. The grid has lots of rows and you can see the vertical scroll bar. Now you edit a column in the first row of grid and press down arrow, the entire row is scrolled up and out of sight. How to make sure we can see the edited row when pressing the down arrow?
Here is the code.
function OnEditKeyDown(controlId) { var grid = ISGetObject(controlId); var selectedObject = grid.GetSelectedObject(); var selectedRow = selectedObject.ToRowObject(); if (selectedRow.Type == "FilterRow") { return true; } else if (selectedRow.Type != "NewRow" && (event.keyCode == "13" || event.keyCode == "40" || event.keyCode == "38")) { window.setTimeout(function () { grid.ExitEdit(1, 0, 0); }, 10); var nextRow = selectedRow.GetNextRow(); if (nextRow != null) { var ac = grid.GetActiveEditCell(); var curRow = ac.rowElement; var tblElm = wgGetTable(curRow); var curRowIndex = curRow.rowIndex; var tbl = grid.Tables[ac.tblName]; var isParent = (tbl.GetChildTables().length > 0) ? true : false; var i = (isParent) ? 2 : 1; var nextRow = event.keyCode == "38" ? curRowIndex - i: curRowIndex + i; //check if current row is the last row of the table if (nextRow >=0 && nextRow < tblElm.rows.length ) { //get destination now var destRow = wgGetRowByPosition(tblElm, nextRow); //highlight the destination row //get the column name var cellName = wgGetColNameByCell(ac.element); //get the destination cell var destCell = wgGetCellByName(destRow, cellName); wgGetRowByElement(destRow).Select(); wgHighlightEditCell(destCell); } } return false; } else { return true; } }
window.setTimeout(function () { wgGetRowByElement(destRow).Select(); wgHighlightEditCell(destCell); }, 1);
Hope this helps.Regards,Hans.
This works. Thanks!
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