I want to hide / remove some below condition options from filter menu,
Next Month and Next year.
Please provide me sample code for this settings.
Hello Sanjay,
Thank you for contacting Infragistics Developer Support!
Currently we do not provide out of the box way to selectively remove filter drop-down conditions. However, what I can suggest as workaround is removing the required condition item from the drop down menu. For example, if you have column with an ID of Sell Start Date you could get reference to the filtering drop down for this column and get the item by the applied css class and remove it. Such as:
//this will remove the lastYear and thisYear filtering conditions $("#grid_dd_SellStartDate").find(".ui-iggrid-filtericonlastyear").closest("li").remove(); $("#grid_dd_SellStartDate").find(".ui-iggrid-filtericonthisyear").closest("li").remove();
//this will remove the lastYear and thisYear filtering conditions
$("#grid_dd_SellStartDate").find(".ui-iggrid-filtericonlastyear").closest("li").remove();
$("#grid_dd_SellStartDate").find(".ui-iggrid-filtericonthisyear").closest("li").remove();
Please note that the css class selector ends with the filter condition name which basically means that you could replace "thisyear" and "lastyear" with the conditions that you would like to remove.
Some further reference about igGridFiltering theming could be found at the following link:
http://help.staging.infragistics.local/jQuery/2015.1/ui.iggridfiltering#theming
I am also attaching a small sample illustrating my suggestion for your reference.
Please let me know if you need any further assistance with this matter.
Thanks so much for giving attention to my requirement.
Actually, i'm looking any setting in grid which allow me to hide some conditions.
Its' okay, i've already made jquery fix for this requirement, BUT your sample is short and simple. Thanks alot.
$(document).delegate("#Grid", "iggriddatarendered", function (evt, ui) {
var $nextMonth = $('.ui-iggrid-filtericonnextmonth');
if ($nextMonth.length > 0) { var $parentNote = $nextMonth.parent().parent(); if ($parentNote.length > 0) { $parentNote.css("display", "none");} }
var $nextYear = $('.ui-iggrid-filtericonnextyear');
if ($nextYear.length > 0) { var $parentNote = $nextYear.parent().parent(); if ($parentNote.length > 0) { $parentNote.css("display", "none");} }});
$(document).delegate("#Grid", "iggridfilteringfilterdialogfilteradded", function (evt, ui) { var $ClientNotesGrid1_container_dialog = $('#ClientNotesGrid1_container_dialog'); if ($ClientNotesGrid1_container_dialog.length > 0) { var $filterTable = $('.ui-iggrid-filtertable', $ClientNotesGrid1_container_dialog); if ($filterTable.length > 0) { var $filterSelect = $filterTable.find('select'); if ($filterSelect.length > 0) { $filterSelect.find('[value="nextMonth"]').remove(); $filterSelect.find('[value="nextYear"]').remove(); } } } });
Thanks once again.
Since currently you are not able to remove filtering conditions out of the box what I can suggest is logging a product idea.You can suggest new product ideas for future versions (or vote for existing ones) at <http://ideas.infragistics.com>.
There are many benefits to submitting a product idea:
- Direct communication with our product management team regarding your product idea.
- Notifications whenever new information regarding your idea becomes available.
- Ability to vote on your favorite product ideas to let us know which ones are the most important to you. You will have ten votes for this and can change which ideas you are voting for at any time.
- Allow you to shape the future of our products by requesting new controls and products altogether.
- You and other developers can discuss existing product ideas with members of our Product Management team.
Steps to create your idea:
1. Log into the Infragistics Product Idea site at http://ideas.infragistics.com (creating a new login if needed).
2. Navigate to the product / platform channel of your choice (e.g. WPF, Windows Forms, ASP.NET, HTML5 / Ignite UI, iOS / NucliOS, etc.)
3. Add your product idea and be sure to be specific and provide as much detail as possible.
The Product Idea site puts you in the driver’s seat and allows you to track the progress of your ideas at any time, see how many votes it got, read comments from other developers in the community, and see if someone from the product team has additional questions for you.