I am using Iggrid. The preferences are stored in the database (Groupby, GroupBySort, column sort etc).
Applying the Columnsort and GroupbySort as follows
// Column Sort this.Details.UserGridSortColumnSettings.push({"columnKey": x.ColumnName, "currentSortDirection": x.IndvidualSort});
// GroupBy Column Sort this.Details.UserGridGroupByColumnSettings.push({ "columnKey": x.ColumnName, "isGroupBy": true, "dir": x.GroupBySort});
After grid initilization, when i select "Sort on Multiple" option, could see sorted columns getting showed twice. whereas Columnsort is displayed once.
In modalDialogContentsRendering event, tried returning unique values as follows, but didnt work.
var uniqueVals = ui.owner._tempExpr; ui.owner._tempExpr = []; return $.each(uniqueVals, function (i, el) { if ($.inArray(el, ui.owner._tempExpr) === -1) ui.owner._tempExpr.push(el); });
Request your help on this
Hello senthil,
I created a small sample trying to reproduce the described issue. For my sample I am using latest service release available for version 15.2, which is 15.2.20152.2174. I created an igGrid with Hiding, Sorting, Filtering, Paging, GroupBy and ColumnMoving behaviors. Every time a user preference for these behaviors is changed I am saving the new preferences in the local storage. When grid is loaded again I am restoring these settings in their last state. Additionally, modalDialogContentsRendering event is handled where I explored the temExpr collections and there was no duplicated values when sorting on multiple on my side. Please keep in mind that _tempExpr is a private method which is not recommended since it could be changed at any point without a public notice.
I am attaching my sample for your reference. Please test it on your side and let me know whether you observe the same behavior in my sample. If this is not an accurate demonstration of what you are trying to achieve please feel free to modify it and send it back to me along with detailed steps to reproduce. Please add any details that you consider relevant.
Please let me know if you need any further assistance with this matter.
Hi Team, thank you for the response. Will check and update you.. Meanwhile, can you please update the event to handle the GroupedColumns click (under grouparea list).
When I click on the GroupedColumns, the sort is happening. However couldn't get the event for the click on the GroupedColumns. Thanks.
Could you please provide me some additional details regarding your requirement. What would you like to achieve by handling the click event for particular column in the GroupedColumns area? The default behavior is, as you mentioned, sorting the column that you clicked. However, if you clarify what you are trying to achieve I could be able to find a solution for your particular scenario.
Looking forward to hearing from you.
In the groupedcolumns area, I was trying to capture and store the Sort for the Grouped Columns in DB..
Hello senthil G,
Thank you for your clarification.
By design, when sorting column from the grouped columns area the groupedColumnsChanged event is fired and the new sorted direction is reflected in the groupedColumns collection. I believe that in this case your requirement could be achieved by saving this collection in order to restore it later.
Please let me know if you have any additional questions afterwards.