Hello,
I implemented enter key support based on this forum post:
http://ko.infragistics.com/community/forums/t/72196.aspx
It works for a single column but not for multiple columns.
So I changed the code based on the combobox filter sample from:
http://ko.infragistics.com/community/forums/p/77913/394333.aspx#394333
$(".ui-iggrid-filterrow.ui-widget").delegate("span.ui-igedit.ui-state-default.ui-widget.ui-corner-all.ui-igedit-container", "igeditorkeydown", function (evt, ui) { if (ui.key === 13) { var $grid = $(gridSelector); var $gridFiltering = $grid.data("igGridFiltering"); var filtering = $grid.data("igGrid").dataSource.settings.filtering; var expressions = filtering.expressions; filtering.expressions = []; var newExpressions = []; // First delete all expressions for this column var colKey = $(this).data("colKey"); for (var i = 0; i < expressions.length; i++) { if (expressions[i].fieldName !== colKey) newExpressions.push(expressions[i]); } // Set a new filter expression var searchValue = $(this).data("igEditor").value(); if (searchValue) { var colIndex = $(this).data("colIndex"); var condition = $gridFiltering.options.columnSettings[colIndex].condition; newExpressions.push({ fieldName: colKey, expr: searchValue, cond: condition }); } $grid.igGridFiltering("filter", newExpressions); //$gridFiltering.filter([], true); // Finally cancel the built-in filtering by using the private _timeoutId handle clearTimeout($gridFiltering._timeoutId); } });
Now I can set filters on multiple columns but I have to press the Enter key in each which is neither intuitive nor practical.
I have the following requirement:
- I need to use editor fields and comboboxes in the filter row
- The user should be able to enter a filter value and then use the Tab key or the mouse to switch to another filter cell
- When done, the user presses the Enter key and the grid displays the records based on all filters
(Filtering is remote using oData. Filtering can take some time and therefore auto-filtering after a delay does not work and makes a bad user experience.)
I cannot see how I can extend and combine Infragistic's samples to achive this? (Filter on multiple columns, use lookup comboboxes in filter row and only press the Enter key once to start filtering.)
Please help...
Thanks!
Best regards,
Joern
Hello Mike,
unfortunately I could not solve this issue with a reasonable amount of time.
It seems like a hack to me.
Also the related issue:
http://ko.infragistics.com/community/forums/p/87280/441090.aspx#441090
I believe using a lookup table and a combobox to filter should be a typical business requirement for a LOB application. Is this something that Ignite UI will support in the near future natively?
Because of this (and more issues) I am at the point of giving up on Ignite UI and I am looking for alternatives.
Hello Joern,
I am following up to see if the information provided has resolved this matter.
Please let me know if I may be of further assistance with this matter.
Thank you for the update. The CSS classes are not internal they are public if you go to the css folder that is included in your project. Those are there to access and change as you need for any styles you want to apply for the controls. Since these are public there are no plans to change the CSS class names in future version of Infragistics.
doesn't the jQuery selector from the "recommended" way:
$(".ui-iggrid-filterrow.ui-widget").delegate("span.ui-igedit.ui-state-default.ui-widget.ui-corner-all.ui-igedit-container"
rely on internals as well?
Copying the value from the combo box to the edit box would have a dependency on the same internal CSS structure as the code above.
In addition there would be only one call to an internal filter function.
Or is the CSS selector from above guaranteed to work in future versions?
Thank you for the update. The recommended way to achieve this is as I described before by building an array of filter settings either as you tab though the columns or when you press the enter key. Then pass that array to the filter method. The method you mention at the bottom of your post isn’t recommended or supported as it would rely on an internal method. The reason for this is the internal method could change and then any of the code you wrote using it would be non-functional.