});
+ if (!this.hiddenListName && this.hiddenName) {
+ this.hiddenListName = this.hiddenName + '-list';
+ }
+
+
}
Roo.extend(Roo.form.ComboBoxArray, Roo.form.ComboBox,
lastData : false,
items : false,
+
+ /**
+ * @cfg {String} nameField The field to take the 'descriptive' display name from
+ */
nameField : 'name',
+ /**
+ * @cfg {String} idField The field to take the hidden 'id' data from
+ */
+ idField : 'id',
tipField : 'email',
- idField : 'id',
-
renderer : false,
-
- hiddenName : false, // set this if you want a , sperated list of values in it for form posting..
+
+ //hiddenName : false, // set this if you want a , sperated list of values in it for form posting..
+ /**
+ * @cfg {String} hiddenListName The field to take the array of hidden 'id' data that is selected
+ */
hiddenListName : false,
hiddenEl : false,
onRender : function(ct, position)
{
-
+ if (!this.hiddenName) {
+ Roo.log("ERROR - ComboBox used without a hidden Name..");
+ Roo.log(this);
+ }
+ this.hiddenListName = this.hiddenName;
+ //kludge the naming for the wrapped combo..
+ this.hiddenName += '-lastselected';
+
Roo.form.ComboBoxArray.superclass.onRender.call(this, ct, position);
- this.wrap.addClass('p-cblist-grp');
+ this.wrap.addClass('x-cbarray-grp');
var cbwrap = this.wrap.createChild(
- {tag: 'div', cls: 'p-cblist-cb'},
+ {tag: 'div', cls: 'x-cbarray-cb'},
this.el.dom
- );
- if (this.hiddenListName) {
+ );
+
- this.hiddenEl = this.wrap.createChild({
- tag: 'input', type:'hidden' , name: this.hiddenListName, value : ''
- });
+ this.hiddenEl = this.wrap.createChild({
+ tag: 'input', type:'hidden' , name: this.hiddenListName, value : ''
+ });
// this.el.dom.removeAttribute("name");
- }
+
this.outerWrap = this.wrap;
this.wrap = cbwrap;
},
+ getName: function()
+ {
+ // returns hidden if it's set..
+ if (!this.rendered) {return ''};
+ return this.hiddenListName;
+
+ },
+
+
onResize: function(w, h){
Roo.form.ComboBox.superclass.onResize.apply(this, arguments);
Roo.extend(Roo.form.ComboBoxArray.Item, Roo.BoxComponent, {
data : {},
cb: false,
- defaultAutoCreate : {tag: 'div', cls: 'p-cblist-item', cn : [
+ defaultAutoCreate : {tag: 'div', cls: 'x-cbarray-item', cn : [
{ tag: 'div' },
{ tag: 'img', width:16, height : 16, src : Roo.BLANK_IMAGE_URL , align: 'center' }
]