I'm new to the Infragistics products as well as the MVC application I'm working on. There is an igGrid that I'd like to enable for multi-column (MC) sorting. I've looked at a fair amount of the online documentation, and I see that MC sorting capability exists, but I haven't found any sample code that illustrates how to enable it. Below is the code I'm using to do the setup.
When I run the application, the grid shows indicators that the 2 specified columns are sorted; however, when I add a new row to the grid, the row set is not sorted. Is there something I need to do/enable so that the grid remains sorted?
Excerpt from relevant .cshtml file:
...
.Features( features => { // Start of added code ?20120720-n features.Sorting() .Mode(SortingMode.Multiple) // Sort on multiple cols .ColumnSettings(settings => { // SORT: 1st on CrewNumber, 2nd on Event settings.ColumnSetting().ColumnKey("CrewNumber").AllowSorting(true).CurrentSortDirection("ascending"); // "asc" or "ascending"; "desc" or "descending" settings.ColumnSetting().ColumnKey("Event").AllowSorting(true).CurrentSortDirection("ascending"); }); // End of added code ?20120720-n features .Resizing().ColumnSettings(settings => { settings.ColumnSetting().ColumnKey("IpSn").AllowResizing(false); settings.ColumnSetting().ColumnKey("IpTx").AllowResizing(false);
}); features.Updating() .EnableAddRow(false) .EnableDeleteRow(!isReadOnly && !disableChangingPreloadedEvents)
Hi Daryl,Fingers crossed that it's of use to you :)Just give us details when (or rather "if" since I'm keeping them fingers crossed) you, so we can help you out.For example, the code snippet and info about the scenario you're trying to accomplish we super - they led me to the conclusion that I pointed out in my previous reply.A good question is the foundation of a good answer :)
Hi Borislav,
Thanks very much for the information you provided. I'll check-out the information in the URL references you provided.
Regards,Daryl
Hi Daryl,I believe you've stumbled upon the case when the AutoCommit option is set to false (which is by default) so the new data you add is added as pending transactions - by design such rows do not participate in operations such as sorting or filtering.A brief mention of the batch editing that is done by the igGrid can be found right here: http://help.infragistics.com/Help/NetAdvantage/jQuery/2012.1/CLR4.0/html/jQuery_Whats_New_12_1_Landing_Page.html#_Ref320709605However, I suggest getting acquainted with the full Updating help article so you can be aware of all of the details:http://help.infragistics.com/NetAdvantage/jQuery/2012.1/CLR4.0?page=igGrid_Updating.htmlFinally, I can recommend the updating-related API references: http://help.infragistics.com/jQuery/2012.1/ui.iggridupdatinghttp://help.infragistics.com/jQuery/2012.1/ui.iggrid#optionshttp://help.infragistics.com/jQuery/2012.1/ui.iggrid#events
In short, if you wish to be able to have sorting on a newly added row, simply set the igGrid AutoCommit option to TRUE.In case you wish to update the grid data on the server-side as well, you will need to call the saveChanges() method as well as described in the help topic mentioned above.Hope this helps.Thanks,Borislav