I think I've found a bug in the igGrid component. When you have the filter text area displayed and you group by a field, the filter text areas get placed in the wrong columns.
Please see the attached image file below to see what I mean.
In this example, the group by field is the ID, but the filter text area in the ID column actually filters the next column (Description). I would expect the filter text areas to be displayed for the columns Description, Option 1 and Option 2, and to be blank for ID (since this is the field grouped on). Instead, the filter text areas are displayed for the columns ID, Description and Option 1, and blank for Option 2.
Can you confirm whether this is a bug, and if there is a planned timeframe for resolving this?
Cheers,
Stephen
Hi Stephen,
You’ve come across a bug in the igGridFiltering. I’ve logged it with internal ID 130031– you can track it using the CASE number associated with it (CAS-107515-Q2J8K1).
The problem comes from the AdvancedModeEditorsVisible option. You can turn it off or switch back to simple mode until the bug is fixed in one of the future SRs.
Best regards,
Martin Pavlov
Infragistics, Inc.
Thanks for looking into this. Below is the code I use to set up the grid model. We do this on the server-side and pass it into the view rather than using chaining in the view itself. The method called to return the GridModel is GetLocalGridModel.
Please let me know if you need any more info.
public static class InfragisticsGridHelper
{ #region Constants
private const int STANDARD_COLUMN_CHOOSER_DIALOG_HEIGHT = 250; private const int STANDARD_COLUMN_CHOOSER_DIALOG_WIDTH = 400; private const string STANDARD_FILTER_DIALOG_HEIGHT = "auto"; private const string STANDARD_FILTER_DIALOG_WIDTH = "auto"; private const string STANDARD_GRID_HEIGHT = "400px"; private const int STANDARD_GRID_PAGE_SIZE = 100; private const string STANDARD_GRID_PAGE_SIZE_LOCATION = "inpager"; private const string STANDARD_GRID_WIDTH = "auto"; private const string STANDARD_GROUP_BY_DIALOG_HEIGHT = "250px"; private const string STANDARD_GROUP_BY_DIALOG_WIDTH = "400px"; private const string STANDARD_MOVE_COLUMN_DIALOG_HEIGHT = "auto"; private const string STANDARD_MOVE_COLUMN_DIALOG_WIDTH = "auto";
#endregion
#region Public Methods
public static GridModel GetLocalGridModel(string gridControlID, string primaryKey, IQueryable dataSource) { GridModel model = GetGridModel(gridControlID, primaryKey, dataSource); model.Features.Add(GetGridFiltering(OpType.Local)); model.Features.Add(GetGridPaging(OpType.Local)); model.Features.Add(GetGridSorting(OpType.Local));
// NOTE: Turning on the Group-By feature prevents the column moving from working correctly. model.Features.Add(GetGridGroupBy(OpType.Local));
model.Features.Add(GetGridSelection()); model.Features.Add(GetGridResizing()); model.Features.Add(GetGridHiding()); model.Features.Add(GetGridColumnMoving());
return model; }
#region Non-Public Methods
private static GridColumnMoving GetGridColumnMoving() { return new GridColumnMoving { Mode = MovingMode.Deferred, MoveType = MovingType.Dom, AddMovingDropdown = true, }; }
private static GridFiltering GetGridFiltering(OpType filterType) { return new GridFiltering { // NOTE: Turning the Mode to FilterMode.Advanced causes an issue with the filters when fields are grouped. Mode = FilterMode.Advanced,
AdvancedModeEditorsVisible = true, FilterButtonLocation = Location.Right, Type = filterType }; }
private static GridGroupBy GetGridGroupBy(OpType groupByType) { return new GridGroupBy { GroupByAreaVisibility = GroupAreaVisibility.Top, Type = groupByType, ModalDialogWidth = STANDARD_GROUP_BY_DIALOG_WIDTH, ModalDialogHeight = STANDARD_GROUP_BY_DIALOG_HEIGHT }; }
private static GridHiding GetGridHiding() { return new GridHiding { ColumnChooserWidth = STANDARD_COLUMN_CHOOSER_DIALOG_WIDTH, ColumnChooserHeight = STANDARD_COLUMN_CHOOSER_DIALOG_HEIGHT }; }
private static GridModel GetGridModel(string gridControlID, string primaryKey, IQueryable dataSource) { return new GridModel { DataSource = dataSource, DataSourceType = "json", ID = gridControlID, PrimaryKey = primaryKey, AutoGenerateColumns = false, ClientDataSourceType = ClientDataSourceType.JSON, Height = STANDARD_GRID_HEIGHT, Width = STANDARD_GRID_WIDTH, VirtualizationMode = VirtualizationMode.Continuous }; }
private static GridPaging GetGridPaging(OpType pagingType) { return new GridPaging { PageSize = STANDARD_GRID_PAGE_SIZE, PageSizeDropDownLocation = STANDARD_GRID_PAGE_SIZE_LOCATION, Type = pagingType }; }
private static GridResizing GetGridResizing() { return new GridResizing { DeferredResizing = false, AllowDoubleClickToResize = true }; }
private static GridSelection GetGridSelection() { return new GridSelection { Mode = SelectionMode.Row, MultipleSelection = false }; }
private static GridSorting GetGridSorting(OpType sortingType) { return new GridSorting { Mode = SortingMode.Single, Type = sortingType, ApplySortedColumnCss = false }; }
#endregion}
Hi Stephen,I tested with advanced filtering mode as well and the grid and features continue to behave correctly.I have the sneaky suspicion that there could be more options influencing the outcome of the scenario.
Thus, can you please copy-paste your configuration of the grid here?(Don't worry - we have HTML and MVC sample projects with mock data and columns)
Thanks in advance - will be looking forward to your reply!
PS: As far as columns are concerned, I'm only interested if you have them defined or do you rely on the AutoGenerateColumns option
Hi Borislav,
Thanks for providing that sample. I've done some more testing, and found that the bug only appears when the filtering Mode is set to FilterMode.Advanced. Can you please test to see if you can reproduce the bug with Advanced mode on? As soon as I turn it off in my tests the bug is gone.
Hi Stephen,We haven't had a bug for this situation and I just tested the scenario you mentioned with the code of the latest Service Release builds.From what I saw, filtering was working properly after a column was grouped.I'm attaching the HTML sample pages I used to check - feel free to take a look at them and let me know if you find any differences with your grid's setup.Hope this helps!Cheers,Borislav