PDA

View Full Version : [FIXED][3.0.0] Bugs with hide TextField



robertoroberto
26 Jul 2009, 4:53 AM
http://extjs.com/forum/showthread.php?t=70494

As I just explain in related issue, I cannot use a Ext.form.Hidden field.

thanks

Condor
26 Jul 2009, 9:09 AM
This can be fixed with this override (http://extjs.com/forum/showthread.php?p=120152#post120152).

ps. Isn't it about time this override gets added to the trunk? There are already hundreds of people using it.

robertoroberto
26 Jul 2009, 11:17 AM
I vote to add it to the trunk...
ty Condor

But I try to use the override for 3.0



Ext.override(Ext.layout.FormLayout, {
renderItem: function (c, position, target) {
if (c && !c.rendered && (c.isFormField || c.fieldLabel) && c.inputType != 'hidden') {
var args = this.getTemplateArgs(c);
if (typeof position == 'number') {
position = target.dom.childNodes[position] || null;
}
if (position) {
c.itemCt = this.fieldTpl.insertBefore(position, args, true);
} else {
c.itemCt = this.fieldTpl.append(target, args, true);
}
c.actionMode = 'itemCt';
c.render('x-form-el-' + c.id);
c.container = c.itemCt;
c.actionMode = 'container';
} else {
Ext.layout.FormLayout.superclass.renderItem.apply(this, arguments);
}
}
});
Ext.override(Ext.form.Field, {
getItemCt: function () {
return this.itemCt;
}
});

but it does'tn works in my example..
what I wrong ?
ty

Animal
26 Jul 2009, 9:30 PM
This can be fixed with this override (http://extjs.com/forum/showthread.php?p=120152#post120152).

ps. Isn't it about time this override gets added to the trunk? There are already hundreds of people using it.

Absolutely. That thread must be one of the most accessed old threads on the forum!

Condor
26 Jul 2009, 10:35 PM
but it does'tn works in my example..

Define "doesn't work"...

I tried your example with the override and it displays just fine without any whitespace.

(did you include the override directly after ext-all.js and before any of your own code?)

robertoroberto
26 Jul 2009, 10:43 PM
I included it in my code
Using debug I can see that the overriden method is called..

I found the mistake.. I don't know if this should be fixed...

if hidden field have


hideParent : true


if doens't works (the behaviour seems the be excatly as you haven't the fix)

Instead it you don't have hideparent : true (so.. it is false) it works fine.

I have done a lot of test and the latest one i'm suing hideParent : true.

So with hideParent : true KO .... using hideParent : false --> OK!

If you want try it is enough that you uncomment the hideParent : true line in my example

Thanks

Condor
26 Jul 2009, 10:47 PM
The override makes hidden:true work correctly.

You should NOT use hideParent:true unless you know what you are doing.

evant
5 Aug 2009, 8:32 AM
A fix for this has been applied to SVN.