Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
125
Remove item from igCombo inside igGrid
posted

Currently I have an igGrid and the first column has an editorType of "combo" with mode of "dropdown". There are three values in the igCombo: "Approved", "Pending", and "Declined".

It's working fine, however I've been given the requirement of removing the "Pending" item from the combo if the value that comes through in the dataSource is either "Approved" or "Declined". In other words, if the Status value is not equal to "Pending", then "Pending" should not be an option in the list. 

I've wrestled with this for awhile and can't figure out how to do it. The two issues I'm running into are:

1) The following jquery code seem to have no effect:

var stat = $('.ui-iggrid-editingcell').text();

if (stat === 'Approved' || stat === 'Declined') {

     $('#grid.igCombo option[value="Pending"]').remove();

}

2) Any attempt to fire a method in the dropDownOpening event, or even after the grid has been initialized results in the error "Cannot call methods on igCombo prior to initialization".

Can you please describe how to remove an item from the igCombo inside the igGrid?

Thanks,

Lance