Skip to content

Select2 fields within afEachArrayItem are not filled correctly #54

@ralph-fuechtenkort

Description

@ralph-fuechtenkort

Hi,

i am using 'afEachArrayItem' to build a row based form for each array item. that works fine, but i have the following issues:

  1. to select the first option, i have to do it twice before its accepted
  2. Within the array, i have another array with string values that are TAGS. I use a helper to generate the options and the options are available in the select, but already selected values are not show even if they are in the options array. This happens not always and NOT TO ALL items of the top array. Please see screenshot below:
    screen shot 2015-12-13 at 9 17 05 am

the relevant code in the helper is:
tags:function(){
return {width:'100%',multiple:true,tags:true,readonly:true};
},

tagsOptions: function () {
    var _editObj = Session.get('editObj');
    var _wf = WorkflowDefinitions.findOne({_id:_editObj.id});
    var _optionsDraft = [];
    var _options = [];
    if (_wf)
    {
        for (var i in _wf.actions){
            for (var ii in _wf.actions[i].from){
                var _from = _wf.actions[i].from[ii];
                if (_optionsDraft.indexOf(_from) < 0){
                    _optionsDraft.push(_from);
                    var _option = {};
                    _option.label = _from;
                    _option.value = _from;
                    _options.push(_option)
                }
            }
        }
    }
    return _options;
},

the field is defined as followed in the template:

{{> afQuickField name= this.current.from select2Options=tags options=tagsOptions label=false}}

i use the following versions on meteor 1.2
aldeed:autoform@5.8.0
aldeed:autoform-select2@2.0.2
aldeed:collection2@2.6.0
aldeed:simple-schema@1.5.0

Any help would be very appreciated

Best regards from manila

Ralph

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions