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 am using Virtual Paging with Grouping. I have a requirement to allow users to set the value of a particular column for all rows currently displayed/expanded.
So, if my Virtual page size is 20 and the user has expanded a group to display 40 rows, if the user clicks on a certain context menu item off of a cell, then all cells currently expanded (40) within that group and that specific column should be updated.
The functionality is actually like a "Fill Down" in Excel. So if a user clicks on a cell - they can fill all the cells below (that are currently expanded on the client side) with that value.
The javascript pseudo code would look something like:
ExpandedRows = GetSelectedCell.GetExpandedRowsinGrouping
For Each Expanded Row
Row.ThisColumn.Value = GetSelectedCell.Value
Has anyone done something similar? Is there a way to get to the list of Expanded Rows within a Group when using Virtual Paing?
Thanks,Dave
Hello Dave,
Based on my investigation for your sample, you can get your following group collection in the current cell (child).
Please try to see the following code.
WebGrid1.GetSelectedObject().ToRowObject().Parent.GetGroupChildRows();
Or, You can also obtain the position.
WebGrid1.GetSelectedObject().ToRowObject().Parent.Position
Hope this codes help.
Regards,Handy
You can use snippet code below to get rows expanded in grouping.
var selectedObject = grid.GetSelectedObject(); var selectedRow = selectedObject.ToRowObject(); selectedRows.GetGroupChildRows().length;
You can see that the length is depend on how many rows that you loaded. Hope this helps.
Handy,
I get an error:
Microsoft JScript runtime error: 'GetGroupChildRows().length' is null or not an object
When I use your suggested option:
var selectedObject = grid.GetSelectedObject();
selectedRow.GetGroupChildRows().length;
I would like to set the value of a particular column, but just for the rows currently displayed within the group where I am selecting a cell.
I apologized for the last line of code. It should be selectedRow instead of selectedRows.The code should work well in normal grouping virtual load. In my case, I am using ClientBinding_VirtualGroupPaging.aspx. I am using the code via button click. To use the button, I need to select a group row.I am not sure why it does not work in your sample. Does your scenario have more than one grouping level?
I am still getting the same error:
My solution is based on that same example - ClientBinding_VirtualGroupPaging.aspx. I have just one level of grouping.
Can you send me your working sample?
Dave
Here is my issue - I am using the OnRowContextMenu to add a "Fill Down" option. I am in a row within a group when I click on the "Fill Down" option. That row does not have any children - it is a child.
I need to get all of the rows within that specific group. I tried to getParent based on that row and then GetGroupChildRows() from there, but I get a javascript error - GetParent is returning a null:
var grid = ISGetObject("WebGrid1"); // get the WebGridRow object // instead of element. var currentRow = grid.GetSelectedObject().GetRowObject(); // get parent row var level = currentRow.GetGroupRowLevel(); alert("Level: " + level); var parentRow = currentRow.GetParentRow(); alert("The parent row of this order is: " + parentRow.KeyValue); // get group child rows of // current row object. var groupChildRows = parentRow.GetGroupChildRows(); var s = "Current selected group row is '" + parentRow.GroupRowText + "'. The child rows contained by this group are: "; for (var i = 0; i < groupChildRows.length; i++) { var row = groupChildRows[i]; s += "Row " + i + ", Type=" + row.Type + ", KeyValue=" + row.KeyValue + " "; } alert(s);
How do I get ALL of the rows for the Group I am currently in?
It is always null because, the row does not have parent. It is a group row. If you inside a child group row, you can get the group row with using ParentPos.e.g
var pos= grid.GetSelectedObject().ToRowObject().ParentPos; grid.RootTable.GetGroupRows()[pos].GetGroupChildRows();
When I run:
var pos= grid.GetSelectedObject().ToRowObject().ParentPos;alert("pos " + pos);
The result is that pos is blank!
Ok, could you please send me a simple sample that replicates this issue? I will try modify it for you. It seems the structure of WebGrid is different from mine. I need to check if some information can be used for your scenario. Thank you.
Here is a sample. If you expand a grouping and then rick click within one of the cells and select "Fill Down" you will see I am not getting anything for var pos= grid.GetSelectedObject().ToRowObject().ParentPos;
What I would like to do is call a WebService and pass the group information as well as the value and name of the current cell/column that I am filling down. Within the WebService I will then make the update in the DB for that grouping. Because I am doing Virtual Paging, I need to update on the server in order to update the rows that have not yet loaded to the client.
So I actually need all of the grouping info based on the current cell/row selected.
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