I am in the process of migrating a few of our applications from v14.2 to v16.1. One of the biggest breaking changes is the base igEditor control is missing:
http://www.igniteui.com/help/api/2015.1/ui.igeditor.html (available)
http://www.igniteui.com/help/api/2015.2/ui.igeditor.html (missing)
http://www.igniteui.com/help/api/2016.1/ui.igeditor.html (missing)
I see in 15.2 that all of the editors were overhauled. More details can be listed here: http://www.igniteui.com/help/whats-new-in-2015-volume2#new-editors
We dynamically iterate through all editors on the grid to provide extended functionality. In the past I would be able to simply say
$(.selector).on("iggridupdatingeditcellstarting", function (e, ui) {
var editor = $(ui.editor).data("igeditor");
if (!editor) {
editor = $(ui.editor).data("igCombo");
}
// EDITOR IS NULL!
};
Now I have to interrogate every possible editor to figure out which type it is! I need to subscribe to key up events.
igEditors:
We used to use the "igeditorkeyup" event.
$(editor).on("igeditorkeyup", function (){}});
igCombo:
We used to use to subscribe the "keyup" event on the $(editor).fieldElem element.
$(editor.fieldElem).on("keyup", function (){})};
How do I do this in a generic fashion with the new set of editor controls?
Hello,
Thank you for your feedback. I understand the difficulties you are having with the recent changes and the migration to the new Infragistics editors. I’m glad you managed to create a workaround for your issue. If you need more assistance or have other questions, don’t hesitate to contact us.
Best Regards, Marina Stoyanova, Software Developer, Infragistics, Inc.
As a work around I just created a helper method that'll return the type of editor. The only downside is there isn't a type of indicator on the data object because hooking up events differs between combo and everything else. Luckily there are common methods between them so that helps. Here's a sample piece:
$.ced.ig.getEditor = function (editor) { var editors = ["igTextEditor", "igNumericEditor", "igCombo", "igDateEditor", "igDatePicker", "igMaskEditor", "igPercentEditor", "igCurrencyEditor"]; for (var index = 0; index < editors.length; index++) { var result = $(editor).data(editors[index]); if (result) { result.__type = editors[index]; return result; } } return null; };
That sucks. Here's why. Let's say we have a grid and I want to subscribe to the cell starting event. In the UI object it'll give me the columnKey and an editor object.
The "best practice" way is to switch on the columnKey so I know which column I am using but now I have to switch provide another switch for the type of editor because their is no common base class.
Question: How can I determine the type of editor that is being passed from the ui.editor field without iterating through them all?
Hello Karthik,
Thank you for using our community.
As you mentioned there was a breaking change in the Ignite UI controls from version 15.2. We have created and build brand new editors based on other architecture in order to provide a better functionality for our controls. For all of the editor we have created a migration topic that should help you migrate from the old ones more easily. Here are the links to those topics:
http://www.igniteui.com/help/migrating-to-the-new-igtexteditor (igTextEditor)
http://www.igniteui.com/help/migrating-to-the-new-ignumericeditor (igNumericEditor)
http://www.igniteui.com/help/migrating-to-the-new-igmaskeditor (igMaskEditor)
http://www.igniteui.com/help/migrating-to-the-new-igdateeditor (igDateEditor)
http://www.igniteui.com/help/migrating-to-the-new-igdatepicker (igDatePicker)
http://www.igniteui.com/help/migrating-to-the-new-igpercenteditor (igPercentEditor)
http://www.igniteui.com/help/migrating-to-the-new-igcurrencyeditor (igCurrencyEditor)
You cannot use igEditor as a reference to all of the editors anymore, you need to access them separately.
If you have further questions, let us know.