Masked Editors do not appear to work with template jquery Grid columns. Is this a known issue / by design?
Thanks Martin, the grid will typically only have 10-12 records. I have it working now.
Hi,
You should use the igNumericEditor.value method.
Given my last sample you can use this call to get the value of the editor with row id 4
var value = $("#lineItem_4").igNumericEditor("value");
Hope this helps,
Martin Pavlov
Infragistics, Inc.
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,
Hi Martin, I'm able to get the numeric editor to correctly show up on my grid now with a template column, thanks for that.
My question is - how do I get at the entered value in the box? When I inspect the html, I don't see the entered text value as the value attribute.
The reason I need this is because I have to invoke another javascript function to compare the value entered in the numeric text to another value (which is the adjacent column - i know how to do this, but I am unable to get the entered value from the igNumeric Editor)
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?