DynamicDropdownTV - ошибка в dynamicdropdown_multiple


Здравствуйте, установил DynamicDropdownTV Понял что он до 2.3 версии revo у меня стоит 2.5, там есть множественный выбор(dynamicdropdown_multiple) Он вообще не работал, я почти его сделал Осталось вывести выбранные значения в select вот http://modx.im/uploads/images/00/23/00/2018/06/04/d6d5b99191.png http://modx.im/uploads/images/00/23/00/2018/06/04/d7793b1cb2.png
Вот код селекта dynamicdropdown_multiple.tpl который я изменил
{$tv->get('value')} <input type="hidden" id="original{$ddId}" name="original{$tv->id}" value="{$tv->get('value')}" /> <div id="div_{$ddId}" value="{$tv->get('value')}" > <a name="cut"></a> </div> <script> // <![CDATA[ {literal} MODx.combo.{/literal}{$ddId}{literal} = function(config) { config = config || {}; Ext.applyIf(config,{{/literal} name: '{$ddId}' ,id: 'select_{$ddId}' ,extraItemCls: 'x-tag' ,expandBtnCls: 'x-form-trigger' ,clearBtnCls: 'x-form-trigger' ,width: 400 ,hiddenName: 'tv{$tv->id}[]' ,renderTo: 'div_{$ddId}' ,triggerAction: 'all' ,mode: 'remote' ,children: Ext.util.JSON.decode('{$children}') ,parents: Ext.util.JSON.decode('{$parents}') {if $params.title},title: '{$params.title}'{/if} {if $params.listWidth},listWidth: {$params.listWidth}{/if} ,maxHeight: {if $params.maxHeight}{$params.maxHeight}{else}300{/if} {if $params.typeAhead} ,editable: true ,typeAhead: true ,typeAheadDelay: {if $params.typeAheadDelay && $params.typeAheadDelay != ''}{$params.typeAheadDelay}{else}250{/if} {else} ,editable: false ,typeAhead: true ,searchible: true {/if} {if $params.listEmptyText} ,listEmptyText: '{$params.listEmptyText}' {/if} ,forceSelection: {if $params.forceSelection && $params.forceSelection != 'false'}true{else}false{/if} ,initiated: true ,allowBlank: {if $params.allowBlank == 1 || $params.allowBlank == 'true'}true{else}false{/if} ,resizable: false ,pageSize: 0 ,url: {$connector_path} ,fields: ['id','name'] ,displayField: 'name' ,valueField: 'id' {if $params.valueDelimiter} ,valueDelimiter: '{$params.valueDelimiter}' {/if} {literal} ,baseParams: { action: '{/literal}{$action}{literal}' ,resource_id: '{/literal}{$resource.id}{literal}' ,object_id: '{/literal}{$object_id}{literal}' ,tvname: '{/literal}{{$tv->name}}{literal}' } ,store: new Ext.data.JsonStore({ id:'id', autoLoad: true, root:'results', fields: ['name', 'id'], remoteSort: true, url: {/literal}{$connector_path}{literal}, baseParams:{ action: '{/literal}{$action}{literal}' ,resource_id: '{/literal}{$resource.id}{literal}' ,object_id : '{/literal}{$object_id}{literal}' ,tvname : '{/literal}{{$tv->name}}{literal}' }, listeners: { 'load': {fn:function(store, records, options ) { //this.hiddenName = config.paramHiddenName; //this.setWidth('350'); } },scope : this } }) ,listeners: { 'select': {fn:this.selectOption,scope:this} ,'render': {fn:this.initSelect,scope:this} } }); MODx.combo.{/literal}{$ddId}{literal}.superclass.constructor.call(this,config); }; Ext.extend(MODx.combo.{/literal}{$ddId}{literal},Ext.ux.form.SuperBoxSelect,{ selectOption: function() { this.refreshChildren(true); MODx.fireResourceFormChange(); } ,initSelect: function() { var parent_field = null; for(i = 0; i < this.parents.length; i++) { parent = this.parents[i]; parent_field = Ext.get('original'+parent); if (parent_field){ this.baseParams[parent] = parent_field.dom.value; } } this.store.load({ callback: function() { this.setValue(Ext.get('{/literal}original{$ddId}{literal}').dom.value); },scope:this }); } }); Ext.reg('modx-combo-{/literal}{$ddId}{literal}',MODx.combo.{/literal}{$ddId}{literal}); Ext.onReady(function() { var fld{/literal}{$tv->id}{literal} = MODx.load({ xtype: 'modx-combo-{/literal}{$ddId}{literal}' }); console.log(fld{/literal}{$tv->id}{literal}); //console.log(fld); //alert('222'); Ext.getCmp('modx-panel-resource').getForm().add(fld{/literal}{$tv->id}{literal}); {/literal} }); // ]]> </script>


Добавить комментарий