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
435
Masked Editors and Template Columns
posted

Masked Editors do not appear to work with template jquery Grid columns. Is this a known issue / by design?

Parents
  • 23953
    Offline posted

    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.

    igGrid_MaskEditorTemplate.zip
Reply Children
  • 23953
    Offline posted in reply to Kunal

    Hi,

    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,

    Martin Pavlov

    Infragistics, Inc.

    igGrid_MaskEditorTemplate_v2.zip