Hi,
New to Ignite grid. We implemented that grid in MVC . We need to get the Last Clicked column in Grid.
Requirement 1.
We add Load more button if user click the Load more button we passed last Clicked sorted column and loaded in Grid again based on that Sorting to maintain.
Requirement 2:
Lazy loading in that grid if user scroll last window we pass the value and load some more data .Here also sorting needed.
Kannan.
Hi Kannan,
Our developers have come back with a solution for this. Someone pointed out that I wasn't setting the Type of the LoadOnDemand feature, which is not inferred when lazy loading. He recommended to set the Type of the LoadOnDemand feature to Remote.
I have followed his suggestion and modified my sample. I am attaching the sample to this post. It demonstrates local sorting with the workaround provided earlier along with including lazy loading.
If you have any further questions or concerns with this, please let me know and I will be glad to help.
Hello Kannan,
I have attached a sample that demonstrates how to lazy load the grid. I create the "Populate Grid" button and when this is called, the grid's datasource is set, which fetches the data from the server. The issue I've encountered is that the entire datasource is retrieved at this point.
I have created a support case for you with an ID of CAS-140890-N9Y7T8. The matter with the full datasource being retrieved has been determined to be a development issue and has been logged in our tracking system with ID: 176945.
I will leave this case open and update you with any new information. You can view the status of the development issue connected to this case by going to the “Account” tab on our website, selecting "My Support Activity" and then this support case will be listed there. Then, you may select the "Development Issues" tab to view details of this development issue.
Please let me know if you have any questions.
The issue I am experiencing with lazy loading appears to be a bug. I am bringing this up with our developers and will have another update with a development issue for you tomorrow.
Regarding the issue with the local sorting not updating after loading additional rows, our developers have suggested the following workaround. An available workaround is to manually sort the column on rowsRequested event. You can handle this with the following code:
<script type="text/javascript"> $(document).on("iggridloadondemandrowsrequested", "#grid1", function () { var $grid = $("#grid1"), grid = $grid.data("igGrid"), sorting = $grid.data("igGridSorting"), i, expr = $.extend([], grid.dataSource.settings.sorting.expressions); for (i = 0; i < expr.length; i++) { sorting.sortColumn(expr[i].fieldName, expr[i].dir); } }); </script>
I will have another update for you tomorrow.
I have created logged issue with locally sorted columns not being sorted after more rows are loaded in our tracking system with ID: 176770. The next step will be for a developer to review my investigation and confirm my findings or to offer a fix, or other resolution.
And regarding my sample that includes lazy loading, I have encountered an issue with loading my data and I am currently discussing this with my supervisor for further guidance.
I will have another update for you on Monday with more information.
I will need some more time to finish putting my sample together. I currently have load on demand working with sorting when sorting is set to remote.
For more information on the differences between local and remote sorting, please see our documentation here:
https://www.igniteui.com/help/14.1/iggrid-sorting-overview
This documentation describes local vs. remote sorting as such:
Sorting can be configured to operate either locally or remotely. In the first case, sorting is done entirely on the client, without the need of any server requests. In the case of remote sorting, the grid encodes the necessary URL parameters so the server can retrieve information about which columns must be sorted.
I have attached my current MVC sample that shows how you can set up Load On Demand and sorting on the igGrid. In my sample I have Sorting set to remote. This means that when sorting a column, the results will be obtained from the server. You will notice a request sent to the server when sorting a column. This allows the sorting to remain consistent when loading more data.
When I have Sorting set to local in my sample, I do see the behavior you are describing where the newly loaded rows are added to the grid without being properly sorted. I am bringing this up with our developers and I will need a little more time to get this together for them.
I will have an update on this for you tomorrow and continue working on my sample to implement lazy loading for this.