Commit 18ad2ef1 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Add the helper function Dbui.getFields.

parent 0f1e5762
......@@ -237,6 +237,39 @@ Ext.define('Dbui', {
return t + f;
},
/**
* Return all descendant fields embedded in the component.
* It includes {@link Ext.form.field.HtmlEditor},
* {@link Dbui.form.field.Dict}, {@link Dbui.form.field.List} and
* {@link Dbui.form.field.Table}.
*
* @param {Ext.Componnent} cmp Component or inherited class
*
* @return {Ext.form.field.Field[]}
*
*/
getFields: function (cmp) {
"use strict";
var fields, fieldTypes;
// list of field which inherite from Ext.form.field.Base
fields = cmp.query('field');
// list of field which do not inherited form Ext.form.field.Base
fieldTypes = ["htmleditor",
"xdictfield",
"xlistfield",
"xtablefield"];
fieldTypes.forEach(function(type) {
Ext.Array.push(fields, cmp.query(type));
});
return fields;
},
/**
* Return the Ext.data.Store identifies by its id.
* If the store does not exit it is created and register in the store manager.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment