Hi all !
A long time since my last question
I want to add properties to a custom TV in Revo 2.1. Here is the code of my properties template :
<div id="tv-input-properties-form{$tv}"></div>
{literal}
<script type="text/javascript">
// <![CDATA[
var params = {
{/literal}{foreach from=$params key=k item=v name='p'}
'{$k}': '{$v|escape:"javascript"}'{if NOT $smarty.foreach.p.last},{/if}
{/foreach}{literal}
};
var oc = {'change':{fn:function(){Ext.getCmp('modx-panel-tv').markDirty();},scope:this}};
MODx.load({
xtype: 'panel'
,layout: 'form'
,cls: 'form-with-labels'
,autoHeight: true
,border: false
,labelAlign: 'top'
,labelSeparator: ''
,items: [{
xtype: 'modx-combo-source'
,fieldLabel: 'Media Source'
,name: 'inopt_mediaSource'
,id: 'inopt_mediaSource{/literal}{$tv}{literal}'
,value: params['mediaSource'] || ''
,width: 200
,listeners: oc
},{
xtype: 'textfield'
,fieldLabel: 'Max Size'
,name: 'inopt_maxSize'
,id: 'inopt_maxSize{/literal}{$tv}{literal}'
,value: params['maxSize'] || ''
,width: 200
,listeners: oc
},{
xtype: 'textfield'
,fieldLabel: 'Forbidden types'
,name: 'inopt_forbiddenTypes'
,id: 'inopt_forbiddenTypes{/literal}{$tv}{literal}'
,value: params['forbiddenTypes'] || ''
,width: 200
,listeners: oc
}]
,renderTo: 'tv-input-properties-form{/literal}{$tv}{literal}'
});
// ]]>
</script>
{/literal}
My problem is that the mediaSource field isn't saved. It does not appear in $params
Did I do something wrong ?
Thanks !
[ed. note: tzoreol last edited this post 14 years, 5 months ago.]