Hi,
How to bind the IgGrid Column with Enum Type. Also need the filter functionality. User should be able to select the Enum value in the Filter dropdown or radio buttons.
We are creating the Grid with Jquery. Remote filter was used.
Thanks
Hello Ramsrinivas,
The most likely reason for this error is putting the constructor code after the grid initialization.
Try putting the constructor at the top of your script – after the Infragistics and jQuery scripts have been loaded, but before trying to initialize the igGrid, at see if this would solve the problem?
In case that does not help, I would appreciate if you please provide the whole html file, or an isolated code sample if you have one. That would allow me to reproduce this behavior on my side, debug and find what is causing the issue.
I look forward to your reply.
Hi Vasil,
Thank you for sending the response.
When i follow the above referred example I am getting below error
editorProvider: new $.ig.CustomComboEditorProvider(),
at the above line
"Uncaught TypeError: $.ig.CustomComboEditorProvider is not a constructor"
Though i have define it.
$(function () {$.ig.CustomComboEditorProvider = $.ig.CustomComboEditorProvider || $.ig.EditorProviderCombo.extend({setSize: function (width, height) {this.editor.element.css({width: width,height: height});},getValue: function () {return this.editor.value();},destroy: function () {this.editor.element.remove();}});});
Please advice.
Thank you for posting in our forum.
Since JavaScript does not have a special Enum type, I guess you refer to some object that you use, where you have defined some properties, is that correct? If that is the case, then using the dataType “object” might be suitable, as it would allow you to bind to a given property by setting a mapper function in the column definition. If I have misunderstood your question, I would appreciate if you please elaborate some more on where and how you use this Enum type.
Please note that if you use a regular object to define the enum types, it would be a good idea to use “const” when declaring it, in order to prevent it from being overwritten/mutated:
const DaysEnum = {"monday":1, "tuesday":2, "wednesday":3 };
Regarding the filtering – here is an online sample that shows using an igCombo editor in a filtering input. That would allow you to have several predefined values in the dropdown and the user would be able to pick some of them when the column need to be filtered.
Please let me know if you have some additional questions.