留言板

formbuilder editor, attr acceptChildren (alloy 1.5).

thumbnail
Fernando Nubla Durango,修改在10 年前。

formbuilder editor, attr acceptChildren (alloy 1.5).

New Member 帖子: 22 加入日期: 09-9-1 最近的帖子
hi!

i have an issue with the formbuilder editor (alloy 1.5).
i´m trying to disable the attribute acceptChildren of a text field but it´s not working the formbuilder always enable me to drop a children field...
the same issue with the textarea type.

<script>
AUI().use(
		'aui-form-builder',
		  function(A) {
			window.myFormBuilder= new A.FormBuilder(
		      {
		        availableFields: [
		          {
		            iconClass: 'aui-form-builder-field-icon-text',
		           // id: 'uniqueTextField',
		            label: 'Text',		       
		            type: 'text',		         
		            width: 75,
		          acceptChildren: false,		        
		            hiddenAttributes: ['showLabel','readOnly','name'],		            		
		          },
		          {		        	
		            iconClass: 'aui-form-builder-field-icon-textarea',
		            label: 'Rich-Editor',
		            type: 'textarea',		           
		             acceptChildren:false,			       
		            hiddenAttributes: ['showLabel','readOnly','name'],
		          }
		        ],
		        boundingBox: '#myFormBuilder',
		        fields: <%=structureJson%>	,	        	
		        	
		      }
		    ).render();
		  }
		);</code></pre></script>
Andrew Novitzki,修改在10 年前。

RE: formbuilder editor, attr acceptChildren (alloy 1.5).

New Member 发布: 1 加入日期: 13-9-24 最近的帖子
Ive got almost the same problem, anybody knows the solution?
thumbnail
Fernando Nubla Durango,修改在10 年前。

RE: formbuilder editor, attr acceptChildren (alloy 1.5).

New Member 帖子: 22 加入日期: 09-9-1 最近的帖子
I think it´s not implemented...
I´ve the same problem with the enableEditing:false,

window.myFormBuilder= new A.FormBuilder(
		      {  enableEditing:false,  
		        availableFields: [
		          { ..............
                          .......
thumbnail
Aravinth Kumar,修改在7 年前。

RE: formbuilder editor, attr acceptChildren (alloy 1.5).

Regular Member 帖子: 152 加入日期: 13-6-26 最近的帖子
Is it working in latest versions?

I m facing the same issue.
Thanks in Advance.


Regards,
Aravinth
thumbnail
Guilherme Cabrini da Siilva,修改在7 年前。

RE: formbuilder editor, attr acceptChildren (alloy 1.5).

New Member 发布: 1 加入日期: 16-4-11 最近的帖子
One way to solve this in Alloy version 3.11.0 was overwriting the FormBuilderField.ATTRS.acceptChildren attribute.

Like this:
YUI.add('custom-form-builder-field', function (Y) {
          function CustomFormBuilderField() {
                 this.disableAcceptChildren();
          }

          CustomFormBuilderField.prototype.disableAcceptChildren = function() {
                 Y.FormBuilderField.ATTRS.acceptChildren.value = false;
          }

          return new CustomFormBuilderField();
}, '0.0.1', {
    requires: [
       'aui-form-builder-field'
	]
});

Now just load the module 'custom-form-builder-field' to disable acceptChildren for all fields.

I don't know if this is the best way to solve but it worked.