I'm using transformedData method as said in this post but with a different propose. I want to export the grids data. I was following 'Suggestion 2' in this post but then I realized that dataView method returns only the current page rows. I want to get filtered rows but from every page (from transformedData documentation that would be the second option: "2. After filtering before paging"). However I've tried and it doesn't work correctly. It returns the result from the last used transformedData method.
Here you can see this odd behavior.
I need to get the records after filtering and sorting but before paging. How can I do?
Hello intecomp,
I investigated your sample in jsFiddle and I noticed that you're looping through an object that you haven't defined: 'filteredData'. I assume that while you were trying to adopt the code from this sample: http://jsfiddle.net/u3jr6fs1/ you didn't change the name of the transformedData object variable. I modified your sample and now it returns the correct data after filtering from every page: http://jsfiddle.net/u3jr6fs1/5/ as per your requirement. If you need further assistance, please let me know.
Regards,
Tsanna
Hello Tsanna, thanks for your reply but I'm afraid the bug is still there.
You were right about using the undefined filteredData variable but it wasn't the problem. I made a few changes to your script:
The script with those two changed works great, you can see it here: http://jsfiddle.net/u3jr6fs1/8/.
But then, I made a second script which adds the call to a function in the click event. That function only calls a few times the method transformedData. It doesn't even use the results. However, the behavior then changes. After that function's execution, the result from transformedData('afterfilteringbeforepaging') is wrong. This second script is here: http://jsfiddle.net/u3jr6fs1/6/.
Looking forward to hear form you,
Diego.
Now I've got your point and after further testing of your code I believe that the returned result due to the transformed data call is correct. The explanation for that is the following: you're calling transformedData method multiple times within the 'useTransformedDataFewTimes' function and with every next time the data is transformed according to its previous state. Therefore when you're calling afterfilteringbeforepaging transform execution for the second time (var afterfilteringbeforepaging2 = dataSource.transformedData('afterfilteringbeforepaging').length), it will transform the data based on the previous transformation call (var afterfilteringandpaging = dataSource.transformedData('afterfilteringandpaging').length) which returns 3 as result. This transformation schema will apply also in the button click event, where you're calling the function and the end result will show only 3 records. So please note that the consequently call of transformeData API method applies on the previously made transformations, it does not start every time from the initial state of the data source. If you want all the records to be shown after transformation of the data source, then you may remove this function call if not necessary for your requirement or please explain me what is your exact purpose of using this function in the current scenario. Waiting for your reply.
Ok, so maybe transformedData is not the function I need.
What I need is to get from the original data source every record that match the filter criteria (if any) that might be shown (current page) or might not be visible (other page). What I mean is, the execution of afterfilteringbeforepaging but using always the original datasource no matter what has been done or called before. Please help me because I really don't understand how I am supposed to do this and it is taking me much longer than it should.
Thanks,
Diego
You can still use transformedData method, but I could not understand why you want to call it so many times one after other? Calling transformedData method with transformed execution: 'afterfilteringbeforepaging' will return all records through the whole data source after filtering, no matter what the current page is. Please let me know why is so necessary for you to use custom function that reapplies the transformations?
Hello Tsanna.
As I told you in my last post, I need to use a different method. This is because I'm using IgniteUI Grid in a web application in a lot of pages. Some of those pages, before and after needing the records (filtered but not paged) use different methods of the grid. I need to make sure that I have a function that whenever its called it returns that information. No matter what has been called before and without affecting what might be called after.
Beside my very specific scenario what I need is a really basic functionality. I want to get every datasource's object which related record is currently on the grid (being shown at current page or not).
Hello,
Thank you for reporting this.
I have asked our engineering staff to examine this further. To ensure that it will receive attention, I have logged this behaviour in our internal tracking system with a Development ID of 192590. A support case is created on your behalf with number CAS-153330-Q8D7G4, so that you can be notified when the bug is fixed.
You can find your active cases under Account - Support Activity in our website. Select your ticket and go to Development Issues tab to view the status of related bugs.
For now I can give you a temporary workaround. Use this code to get the filtered data without the paging applied to it:
function getData() { var ds = $('#table1').data('igGrid').dataSource; var transData; if (ds._filter) { transData = ds._filteredData; } else { transData = ds.data(); } return transData; }
Let me know if I may be of further assistance.
Kind Regards, Petko Zhekov Senior Software Engineer
Your development issue has been addressed in our latest service release which is available for download.
Please let me know if you come across any further issues with the new service release or if you have any further questions .
Kind Regards,
Petko Zhekov
Software Developer
Infragistics, Inc.