Hi,
I am using ignite ui grid directive in angular js.
getting error
provider.createEditor is not a function
I am creating custom editor provider for one column in grid
using below code
$(function () { $.ig.EditorProviderNumber = $.ig.EditorProviderNumber || $.ig.EditorProvider.extend({ // initialize the editor
createEditor: function (updating, key, columnSetting, tabIndex) { // updating - reference to igGridUpdating feature // key - the key of the colomn. There is only one editor instance per column // columnSetting - settings set by the user in iGridUpdating.columnSettings[] // tabIndex - the tabIndex of the editor var element = $('');
this.editor = element;
element.on("keydown", function () { // notify igGridUpdating that the value is changed updating._notifyChanged(); }); return element; }, // get editor value getValue: function () { return this.editor.val(); }, // set editor value setValue: function (val) { return this.editor.val(val || 0); }, // size the editor into the TD cell setSize: function (width, height) { this.editor.css({ width: width - 2, height: 100, borderWidth: "1px", backgroundPositionY: "9px" }); }, // focus the editor setFocus: function () { this.editor[0].select(); }, // validate the editor validator: function () { // no validator return null; }, // destroy the editor destroy: function () { this.editor.remove(); } }); })
------
and consuming above code with html mark up
<column-setting column-key="comments" editor-provider="new $.ig.EditorProviderNumber()"></column-setting>
----
Hello Gaurav,
editorProvider option in igGrid accepts a value of type "object", not "string". You may assign the custom editor provider on some variable defined in the scope and then pass it to the editorProvider option, or use the following syntax: <column-setting column-key="comments" editor-provider="{{new $.ig.EditorProviderNumber()}}"></column-setting>. If you have further questions, please let me know.
RegardsTsanna
facing error:
TypeError: o.createEditor is not a function
Please give me more details around this error. Did you try any of my suggestions? Are you facing this error with any of my suggestions? Please send me a sample, that I can run and test on my side.
Regards,Tsanna