jQWidgets Forums

jQuery UI Widgets Forums Grid Create Editor Dynamically

This topic contains 1 reply, has 1 voice, and was last updated by  Benji6996 10 years, 9 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Create Editor Dynamically #55256

    Benji6996
    Participant

    I am trying to apply a jqxNumberInput dynamically to any number columns within my grid. However, when I click to edit the row, it does not apply the number input and when I try to tab away from the cell, I get an error saying “Uncaught TypeError: undefined is not a function”.

    Here is a snippet of my code:

    for(var x in data.columns){
    	if(typeof data.columns[x].cellsformat!=='undefined'){
    		data.columns[x] = $.extend({
    			createeditor: function(row,cellvalue,editor){
    				editor.jqxNumberInput({ digits: 3 });
    			}
    		},data.columns[x]);
    	}
    }
    
    $('#grid').jqxGrid({
    	source: dataAdapter,
    	selectionmode: 'singlerow',
    	columns: data.columns,
    	editable: true,
    	editmode: 'selectedrow',
    	rendergridrows: function(obj){
    		return obj.data;
    	}
    });
    Create Editor Dynamically #55258

    Benji6996
    Participant

    Apologies for this thread, very dumb mistake from me. I forgot to put columntype: 'numberinput'

    All sorted 🙂

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.