Results 1 to 4 of 4

Thread: Has form Layout trackLabels been fixed in 3.1.1

  1. #1
    Sencha User Keith Chadwick's Avatar
    Join Date
    Nov 2009
    Location
    Ottawa Canada
    Posts
    50

    Default Has form Layout trackLabels been fixed in 3.1.1

    I have a fairly complex form that is rendered in a modal window. After I show the window I have several tests to decide which form components to show or hide. When I use Ext.getCmp('controlID').setVisible((mytest)) the control hides and shows correctly but the label never hides.

    I have read through many posts regarding this issue in this forum and the 3x bug forum and I am unclear if this issue has been resolved yet.

    I did manage to get it to work with Ext.layout.FormLayout.prototype.trackLabels = true as suggested by Animal on the post http://www.extjs.com/forum/showthrea...152#post120152

    My config is as follows but did not work until I did the prototype (below is just a partial), as you can see I tried putting trackLabels just about everywhere:
    Code:
    {
                       title: 'Note',
                       layout: 'fit',
                       trackLabels:true,
                       width: 800,
                       height: 550,
                       closeAction: 'close',
                       plain: true,
                       modal: true,
     
                       items: [{
                           xtype: 'form',
                          trackLabels:true,
                          layout:'form',
                           id: 'coreNote',
                           autoTabs: true,
                           activeTab: 0,
                           deferredRender: false,
                           border: false,
                           defaultType: 'textfield',
                           padding: '20',
                           monitorValid: true,
                           method: 'POST',
                           defaults: {
                               anchor: '100%',
                               trackLabels:true
                           },
                           items: [{
                               xtype: 'label',
                               cls: 'noteMessage ' + clsClass,
                               html: message,
                               hidden: topMessageHidden
                           }, {
                               xtype: 'displayfield',
                               fieldLabel: 'Object',
                               value: mb3.core.title.getTitle()
                           }, {
                               xtype: 'textfield',
                               id: 'coreNoteSubject',
                               fieldLabel: 'Subject',
                               name: 'subject',
                               allowBlank: false,
                               value: current.title
                           }, {
                               xtype: 'htmleditor',
                               fieldLabel: 'Note',
                               height: 150,
                               fielLabel: 'Note',
                               allowBlank: false,
                               id: 'coreNoteComment',
                               name:'comment',
                               value: current.comment
                           }, {
                               xtype: 'checkbox',
                               fieldLabel: 'Mark As Resolved',
                               checked: false,
                                id:'coreNotMarkAsResolved',
                               name:'markAsResolved',
                               hidden:true
                           }]}}
    Cheers
    Keith

  2. #2

    Question Did anyone get this to work?

    I have something similar, and when trying to hide a TextField, the label never goes away... I have added the trackLabels and boiled my form down to its most basic, but the label will never get hidden. Any ideas?

    Code:
    var form = new Ext.form.FormPanel({
    	bodyStyle: 'padding-top: 5px;'
      , id: 'content-group-form'
      , labelWidth: 110
      , hideMode: 'offsets'
      , width: 385
      , trackLabels: true 
      , defaults: {
    		width: 200
    	  , border: false
    	  , frame: false
    	  , plain: true
    	}
      , items: [{
    		xtype: 'textarea'
    	  , fieldLabel: 'Content'
    	  , id: 'content-group-form-content'
    	  , name: 'content-group-form-content'
    	}, {
    		xtype: 'checkbox'
    	  , boxLabel: 'Enable'
    	  , id: 'content-group-form-enabled'
    	  , name: 'content-group-form-enabled'
    	}]
      , buttons: [
    		{text: 'Hide', handler: function() {
    			var textarea = Ext.getCmp('content-group-form-content');
    
    			if (textarea.hidden) {
    				textarea.show();
    			} else {
    				textarea.hide();
    			}
    		}}
    	]
    });

  3. #3
    Ext User supremeDK1's Avatar
    Join Date
    Feb 2010
    Location
    Germany, Gtersloh
    Posts
    3

    Default

    Hi,

    my Problem is similiar to yours but hopefully I can help you with my previous solution.

    You can try this:

    comp.disable();
    comp.hide();
    comp.getEl().up('.x-form-item').setDisplayed(false);

    With the last line you can hide the label. But this solution only works after all comps has been finished. If not you get an Error like this: "comp.getEl() is undefined".

    But for me this solution is no longer working because when I initialize the Element I must hide it immediately and then i get errors like above.

    So any solutions or ideas?

    Greetings
    Daniel

  4. #4
    Sencha User igaenssley's Avatar
    Join Date
    Dec 2007
    Location
    Atlanta, GA
    Posts
    25

    Default

    While this is a global change, Condor had a good solution. Before you build your form, just set trackLabels to true in Ext's defaults.

    Ext.layout.FormLayout.prototype.trackLabels = true;

    I tried every solution out there and this it the only one that worked. Don't know what the problem is.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •