Masked Editors do not appear to work with template jquery Grid columns. Is this a known issue / by design?
Hi,
I'm not sure what you're trying to accomplish. Can you explain what is your use case?
Attached you can find a sample which demonstrates igGrid with igNumericEditor in StandardCost column.
The sample is implemented in two steps:
First, I define column template for the StandardCost column. In the template I use plain INPUT type='text' element.
Second, after the grid is initialized I select all the INPUTs in the StandardCost column and initialize igNumericEditor on them.
If you're using igGridUpdating then you can use columnSettings to define your editor. Please, refer to the igGrid Updating document for more information.
Hope this helps,
Martin Pavlov
Infragistics, Inc.
My case is this:
I have a grid - where I have a template column to show a field. We have disabled updating and will manage updating ourselves. So consider a grid with three columns, the third column having an input text box as a template column. Basically just <input type="text" id='lineItem'> etc. We want to put a masked editor here so I saw the documentation and tried
$('#lineItem').igMaskEditor({ inputMask: 'CCCCC' });
But it seems to have no effect. Do I have to put the line above after the initialized event?
Thanks Martin, the grid will typically only have 10-12 records. I have it working now.
The W3C HTML 4.01 Specification states that the id attribute must be unique. Keep in mind that when you define template it will be evaluated for each row in the grid. In your case you'll have the same id(lineItem) for each row in the grid. However browser will not complain.
When you try to create igMaskEditor you're using jQuery ID selector which is returning only one element, so you'll end up with only one igMaskEditor for the first row.
I suggest that you concatenate the primaryKey value to the id of the INPUT element in the template or use data-* attribute so you can access the editor value at later stage.
I modified my sample to demonstrate this.
Keep in mind that there will be an overhead when you instantiate igMaskEditor many times, so you should keep the row count low or use virtualization. Also your page will use more memory.
My personal feeling is that what you're trying to accomplish is not the best solution. Maybe better solution is to use only one igMaskEditor and inject it in the cell when the user click on it. This way you will use fewer browser resources.
Best regards,