0
私はthis jsfiddle exampleのようなことをしたい、左のパネルのプロパティにいくつかのカスタム属性を配置する必要があります。 'フォームノード'AlloyUIフォームビルダにカスタム属性を追加する方法は?
ATTRS: {
type: {
value: 'custom'
},
customAttr: {
validator: Y.Lang.isString,
value: 'A Custom default'
}
},
EXTENDS: Y.FormBuilderFieldBase,
prototype: {
getPropertyModel: function() {
var instance = this;
var model = Y.FormBuilderFieldBase.superclass.getPropertyModel.apply(instance, arguments);
model.push({
attributeName: 'customAttr',
name: 'Custom Attribute'
});
return model;
}
}
});
Y.FormBuilder.types['custom'] = Y.MyFormCustom;
var availableFields = [
{
iconClass: 'form-builder-field-icon-button',
label: 'Button',
type: 'custom'
}
];
myform= new Y.FormBuilder({
availableFields: availableFields,
boundingBox: '#myHolder'
}).render();
Iドン:私は同様にすることを試みたが、私は
YUI().use('aui-form-builder',function (Y) {
Y.MyFormCustom = Y.Component.create({ NAMEフィールドをドラッグすることはできません以下フォームは、任意の助けが理解されるであろう。表示されない理由」tは知っている。
: リンクを参照してください。 上記のコードで** EXTENDS:Y.FormBuilderFieldBase **の場合** availableFields ** _type_は入力タイプのフィールド要素である必要があります – geo007us