Problem with config "inputmask" with array field ({{#each...}})?


#1

I have like this:

<button type="button" class="addNew">Add New</button>

{{#each items}}
        <div class="row list">
            <div class="col-sm-4">{{> afQuickField name=indexNmae value=name class="name" readonly="true" label=false}}</div>
            <div class="col-sm-2">{{> afQuickField name=indexQty type="text" value=qty class="qty" label=false}}</div>
            <div class="col-sm-2">{{> afQuickField name=indexPrice type="text" value=price class="price" label=false}}</div>
            <div class="col-sm-3">{{> afQuickField name=indexAmount type="text" value=amount class="amount" readonly="true" label=false}}</div>
            <div class="col-sm-1">
                <button type="button" class="btn btn-danger removeItem">-</button>
            </div>
        </div>
 {{/each}}
// on helper
items: function(){
   return itmes.list();
}

// on render (config inputmask)
var element = [$('.qty'), $('.price').......];
_.forEach(element , function (val) {
            val.inputmask('decimal', {
                autoUnmask: true,
                //removeMaskOnSubmit: true,
                rightAlign: false,
                radixPoint: ".",
                autoGroup: true,
                groupSeparator: ",",
                groupSize: 3,
                digits: 2
            });
        });
  • first: items.list = [] // empty
  • and then, I click btn addNew to add new (reactive list)
    The problem in template list don’t know inputmask.
    Please help me.