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.
Hi, could you please give us a solution to remove the filters in Ignite UI 2220.1
I am not finding the dropdown grid_dd_SellStartDate once i change the references from 2015.1 to 2020.1
Thanks
sridhar