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
We just started using self referencing grids and are running into the following issue. The code below only returns one valid row, the first one. After that all GetRow() calls return null. We are in a bind as we need the rows collection so any assistance to resolve this quickly is much appreciated.
Client side JavaScript to retrieve the rows (works fine with normal grids):
// TotalLoadedRows is correctvar iRows = oGrid.TotalLoadedRows; var arRows = null; for (var i=0; i < iRows; i++) { // this line returns a valid object only when i is 0, // after that, returns null for remaining calls var oRow = oGrid.RootTable.GetRow(i); if (oRow == null) { continue; } if (i == 0) { arRows = new Array(); } arRows.push(oRow); }
Hello Yousif,
Unfortunately, there is no workaround for now. Even though we can access all data in dataset, the export itself uses ActiveReports engine. It needs to be enhanced from Active reports first. I already saw that you post the request in another thread. It will be forwarded to our developer teams. Thank you.
Regards,Handy
I just found why this is the way it is. It looks like that even though the TotalLoadedRows is 3, in this example, there are more rows loaded as the children. The 3 parent VISIBLE rows are not necessarily at positions 0, 1 and 2 respectively due to the children being at their respective positions.
Short of writing my own custom property to contain the total number of rows in the data set, how would I determine the ACTUAL number of rows loaded on the client side? Even though I may only see 3 initially, there may be hundreds loaded as children. So how do I get that number?
I need to know so I can loop through the correct number of items and get the items I need per the code above. Thank you.
[EDIT] I found one more issue. When we do expand a parent row, let's say it has 4 child rows, the TotalLoadedRows stays at 3 as it does not get updated to 7 which would be the correct number of loaded rows now.
Hello,
This is a default behaviour in SelfReference scenario because the self child row only refer into a parent row. That's why it is count as one.
However, if you want, you can calculate them manually. We have GetSelfRefChildRows() method in a row object. You can get the row object by getting selected row or loop the root table for each row manually.
Example, grid.RootTable.GetRow(0).GetSelfRefChildRows();
Hope this helps.
Hello Handy,
Okay, that's what I was looking for. I'll give that a try. Thank you.
How do I export the visible rows? My grid initially displays 3 parent rows. I then expand several rows, but when I export, it only exports the 3 initial rows? How do you recommend I get the export to include all the visible/expanded rows?
I do have the OnExport overriden already to help export the extra loaded rows from our normal grids, but am not sure how to customize it for a self-referencing grid.
Hi Yousif,
Unfortunately, our current export does not support for Self-Reference grid right now.
Is there a workaround I can apply in the server-side code in the OnExport? I have access to all the data in the data set. What about the export itself, i.e., is there an API I can call and pass the data set to get the data in the format requested or something similar? Thank you.
Okay, thanks Handy. Yeah, I posted it as a request separately since it was off topic in this thread and figured others who want the feature can chime in. ;)
Thanks, we appreciate it much.
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