We have a hidden column that we require our grids to be sorted on. The column contains information that the user cannot see or interact with.
The problem is that if we call igGridSorting("sortColumn" on this hidden column, a javascript exception is thrown.
I have traced the problem down to the following code in infragistics.ui.grid.sorting.js:
// M.H. 19 July 2012 Fix for bug #113505 if (this.grid._detachedHeaderCells && isSingleMode && cs[i].columnKey && this.grid._detachedHeaderCells[cs[i].columnKey]) { if (cs[i].currentSortDirection !== undefined && cs[i].currentSortDirection !== null) { delete cs[i].currentSortDirection; } It seems that any column specified as a hidden column is added to the detachedHeaderCells array, which causes the sorting on the column to be removed, leading to js exception when subsequent code tries to access to currentSortDirection.Changing the column to unhidden resolves the issue, but breaks our application requirement. Has this been fixed or is there any workaround to prevent adding the hidden sort column to the detachedHeaderCells array?(We have to use programmatic sort after inserting a row because inserting an entry directly into the datasource results in a loss of the transaction data for that row.)
That would be great if someone could explain how this is done.
I have found it to be very difficult to discover information for Ignite versus previous Infragistics products (I have been working with the .Net components for 10 years and other components even longer).
For example, in the local help (which I often reference while disconnected), searching for a term and then selecting it takes you to the very unhelpful main navigation page as opposed to the actual term.
In addition, the hiearchy of classes (i.e. columnSettings) is buried and difficult to understand.
And finally, the examples are decent for relatively trivial items, but don't go far enough in explaining more complex issues. A perfect example is the conditional row style example. Although the example shows the code, it would be MUCH more useful to explain precisely what the code does rather than having the user try to piece together what is happening from the code sample. In otherwords, explain that each cell must have the style applied separately in order to style the entire row. It is not easy to grasp this concept from the sample code without performing an in-depth analysis of how the conditions are applied.
Hi Karl,
As a workaround to your issue I would suggest to sort the column in the igDataSource and then rebind the grid.
Modifying the source code yourself will harden the process of upgrading to newer Ignite UI version.
Best regards,
Martin Pavlov
Infragistics, Inc.
Even though the developers have stated this is "as designed", there is a trivial fix to the problem. Pass the current s in method sortColumn to _clearSortStates, then modify the following code in _clearSortStates:
// M.H. 19 July 2012 Fix for bug #113505 if (this.grid._detachedHeaderCells && isSingleMode && cs[i].columnKey && this.grid._detachedHeaderCells[cs[i].columnKey]) { if (cs[i].currentSortDirection !== undefined && cs[i].currentSortDirection !== null) { delete cs[i].currentSortDirection; } this._clearHeaderCellSortState(this.grid._detachedHeaderCells[cs[i].columnKey][0]); }to be:
// M.H. 19 July 2012 Fix for bug #113505 if (this.grid._detachedHeaderCells && isSingleMode && cs[i].columnKey && this.grid._detachedHeaderCells[cs[i].columnKey]) { if (typeof s != 'undefined' && s && cs[i].columnKey == s.columnKey) { // We are sorting on a hidden column and this is the hidden column, so don't clear the sort info } else { if (cs[i].currentSortDirection !== undefined && cs[i].currentSortDirection !== null) { delete cs[i].currentSortDirection; } this._clearHeaderCellSortState(this.grid._detachedHeaderCells[cs[i].columnKey][0]); } }
Hello Karl, I have opened a support ticket with ID - CAS-110268-R3B7V8 which is visible for you if you log in our website and go to Account > Support activity. We will continue our communication regarding the issue through the support ticket.