meteor-autoform-select2 icon indicating copy to clipboard operation
meteor-autoform-select2 copied to clipboard

Select2 fields within afEachArrayItem are not filled correctly

Open ralph-fuechtenkort opened this issue 9 years ago • 2 comments
trafficstars

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:[email protected] aldeed:[email protected] aldeed:[email protected] aldeed:[email protected]

Any help would be very appreciated

Best regards from manila

Ralph

ralph-fuechtenkort avatar Dec 13 '15 01:12 ralph-fuechtenkort

+1

odb366 avatar Mar 14 '16 15:03 odb366

+1

#https://github.com/vazco/meteor-universe-autoform-select/issues/29#issuecomment-200797309

acomito avatar Mar 24 '16 14:03 acomito