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 need the behaviour of MS Excel while editing the grid cells. After users modified a cell content followed by pressing Enter key the next cell at the next row (rowIndex+1) at the same column will be directly highlighted.
I got a solution from
http://support.intersoftpt.com/docs/webgrid/5.0.7200/Reconfigure%20the%20Enter%20key%20functions%20on%20EditMode.html
It is as follows
function WebGrid1_OnEditKeyDown(controlId){ if(event.keyCode == 13) { //cancel the event as it'll be handled manually event.returnValue = false; var grid = ISGetObject("WebGrid1"); //get currently active edit cell var ac = grid.GetActiveEditCell(); if(ac.rowElement.type == "Record") { //get the table object var tbl = grid.Tables[ac.tblName]; grid.ExitEdit(1,0,0) // exit and update the row if dirty
//find out if the table of current row is parent var isParent = (tbl.GetChildTables().length > 0)?true : false; window.setTimeout(function() {SelectNext(ac, isParent);},500); //you can try to remove this line if you receive a javascript error return false; } } return true; } function SelectNext(ac, isParent) { var curRow = ac.rowElement; var tblElm = wgGetTable(curRow); var curRowIndex = curRow.rowIndex; //if a table is a parent, the index numbering increases by 2 var i = (isParent)? 2 : 1; //check if current row is the last row of the table if(curRowIndex < tblElm.rows.length-i){ //get destination now var destRow = wgGetRowByPosition(tblElm, curRowIndex+i); //highlight the destination row //wgHighlightROw(destRow); //get the column name var cellName = wgGetColNameByCell(ac.element); //get the destination cell var destCell = wgGetCellByName(destRow, cellName); //select nextRow and highlight the destination cell window.setTimeout(function() { MoveRow(destRow,destCell);}, 500); } } function MoveRow(destRow, destCell) { wgGetRowByElement(destRow).Select(); wgHighlightEditCell(destCell); }
The proble with this is in wgGetRowByElement(destRow).Select()
When i have columns outside the viewable area and the horizontal scrollbar is enabled. Then when i select the next row, the horizontal scroll bar flickers. that is, it goes to position 0 (zero) and comes back to appropriate position to focus the highlighted cell. I want to keep the scroll bar fixed.
Any idea of this?
Thanks
Zahid
Hi Zahid,
I am really sorry but its the default behaviour of WebGrid if we select a row the focus will be on first cell.
If you want you can use AutoFit columns in the WebGrid it will make all the column fit in the WeBgrid without horizontal scrollbar.
Best Regards,
Gordon Tumewu
When i have columns outside the viewable area and the horizontal scrollbar is enabled. Then when i select the next row, the horizontal scroll bar flickers. that is, it goes to position 0 (zero) and comes back to appropriate position to focus the highlighted cell. I want to keep the scroll bar fixed. Any idea of this? Thanks Zahid
Zahid, do you have column freezing enabled? The row selection and cell selection should be running synchronously so the horizontal scrolling/flickering shouldn't be noticed.
Hi James,
Thanks for your post. I have column freezing enabled.
When i have one or more columns frozen then there is no flickering and everything works fine. Otherwise not
Did you mean that, there should be no flicker even if we dont have any column frozen and just freezing is enabled?
Zahid, not sure if this will help, but you can try to reduce the timeout length that invokes the method, from 500 to 50. See if that reduces or eliminates the flickering issue.
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