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
40
Ingragistics grid direcive in angular js
posted

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>

----

getting error

provider.createEditor is not a function

Parents
No Data
Reply
  • 15320
    Offline posted

    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.

    Regards
    Tsanna

Children