Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: change value of allowBlank parameter

  1. #11
    Sencha User
    Join Date
    May 2014
    Posts
    5
    Vote Rating
    0
      0  

    Default Red asterisk missing

    Thanks. So It's working fine for me, however, the red asterisk does not appear at all even after setting allowBlank = false.

    Is there any way to overcome this side effect. So far I used two identical fields (one allowBlank=true and other false) with different ids. I toggle their visibility as needed but this is absurd solution.

  2. #12
    Sencha User sword-it's Avatar
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,335
    Vote Rating
    91
      0  

    Default try to update label

    you can update your field's label innerHTML :
    Code:
    yourfield.labelEl.update('New label <span style="color:red">*</span>');
    or use setText method for your field label
    http://docs.sencha.com/extjs/3.4.0/#...method-setText

    Code:
    yourFieldLabel.setText('New label <span style="color:red">*</span>');
    sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.

  3. #13
    Sencha User
    Join Date
    Apr 2014
    Posts
    3
    Vote Rating
    0
      0  

    Default

    Can you please tell me how to validate this type of validations in functions .. var reqDependency20_1=((Ext.getCmp('i_7_2158_id') != undefined)?((((Ext.getCmp('i_7_559_id').getInputValueCT()+'') == '')&& ((Ext.getCmp('i_7_1846_id').getInputValueCT()+'') == '')&& ((Ext.getCmp('i_7_577_id').getInputValueCT()+'') == '')&&((Ext.getCmp('i_7_2158_id').getInputValueCT()+'') == '')&&((Ext.getCmp('i_7_2295_id').getInputValueCT()+'') == '')) ? true : (((Ext.getCmp('i_7_565_id').getInputValueCT()+'') != '') ? true (Ext.getCmp('i_80_1068_id').getInputValueCT()+'') == 'Audited')?true(Ext.getCmp('i_7_559_id').getInputValueCT()+'') == '')&& ((Ext.getCmp('i_7_565_id').getInputValueCT()+'') == '')&&((Ext.getCmp('i_7_1846_id').getInputValueCT()+'') == '')&&((Ext.getCmp('i_7_2158_id').getInputValueCT()+'') == '')&&((Ext.getCmp('i_7_2295_id').getInputValueCT()+'') == '')&& ((Ext.getCmp('i_7_577_id').getInputValueCT()+'') == '')))))((Ext.getCmp('i_7_559_id').getInputValueCT()+'') == '')&& ((Ext.getCmp('i_7_1846_id').getInputValueCT()+'') == '')&& ((Ext.getCmp('i_7_577_id').getInputValueCT()+'') == '')&&((Ext.getCmp('i_7_2295_id').getInputValueCT()+'') == '')) ? true : (((Ext.getCmp('i_7_565_id').getInputValueCT()+'') != '')? true (Ext.getCmp('i_80_1068_id').getInputValueCT()+'') == 'Audited')?true(Ext.getCmp('i_7_559_id').getInputValueCT()+'') == '')&& ((Ext.getCmp('i_7_565_id').getInputValueCT()+'') == '')&&((Ext.getCmp('i_7_1846_id').getInputValueCT()+'') == '')&&((Ext.getCmp('i_7_2295_id').getInputValueCT()+'') == '')&& ((Ext.getCmp('i_7_577_id').getInputValueCT()+'') == ''))))));

  4. #14
    Sencha User
    Join Date
    May 2014
    Posts
    5
    Vote Rating
    0
      0  

    Default Thanks. One works other does not

    yourfield.labelEl.update() method works but you have to append the labelSeparator (default to':') manually.yourFieldLabel.setText() does not work. I guess you meant to say yourfield.setFieldLabel() which works as well as appends labelSeparator automatically.

  5. #15
    Sencha User
    Join Date
    May 2017
    Posts
    1
    Vote Rating
    0
      0  

    Default

    Hi. I got a question that relates to this is.

    I am trying to change the networksearchfield to not have a require field
    when it's on modify
    In this code for example if you go to setMode (below) it's a function
    that changes if the mode is modify then the search field is shown.

    HTML Code:
    //--------------------------
        // Change the state of the form
        ,setMode: function( mode ) {
    this.mode = mode ;
    var delbut = this.findButton('deletebutton');
            if ( mode === 'add' ) {
    this.setButtonText('submitbutton','Add') ;
    this.hideSearchFields();
                // add/hide a 'delete' button ?
                if ( delbut ) {
    delbut.hide();
                }
            }
            if ( mode === 'modify' ) {
    this.setButtonText('submitbutton','Modify') ;
    this.showSearchFields();
                // add/hide a 'delete' button ?
                if ( delbut ) {
    delbut.show();
                }
            }
        }

    I want to achienve something like this. Any ideas?

    HTML Code:
    setMode: function( mode ) {
    this.mode = mode ;
    
    if ( mode === 'add' ) {
    allowBlank: true 
    }
    
    if ( mode === 'modify' ) {
    allowBlank: false
          }
    }
    Here is what I am trying to achieve

    HTML Code:
    IB.form.NextIPClass = Ext.extend(IB.form.FieldSet, {
        // component defaults
        collapsed: false,
        checkboxName: 'getnextip',
        title: 'Get Next IP Address',
        itemID: 'getnextip'
    
       setMode: function( mode ) {
       this.mode = mode ;
     
        ,initComponent: function () {
     //apply ( object, config, [defaults] ) : Object
     //Copies all the properties of config to the specified object. There are two levels of defaulting supported:
     
            Ext.apply(this, {
                // objects need to go here..
                items: [
                    {
                        xtype: 'IBNetworkSearchField',
                        itemID: 'nextipnetwork',
                        clearForm: false,
                        searchAlways: true,
                        width: 'auto',
                        fieldLabel: 'Network',
                         setMode: function( mode ) {
                                  if ( mode === 'modify' ) {
                         allowBlank: false
                    }
    
                    },{
                        xtype: 'IBNextIPButton',
                        width: 50
                        //itemID: 'getnextip',
                        //name: 'getnextip'
                    }
                ]
            });

  6. #16
    Sencha User
    Join Date
    May 2011
    Posts
    7
    Vote Rating
    0
      0  

    Default

    Yes, this works perfectly.






Page 2 of 2 FirstFirst 12

Posting Permissions

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