Results 1 to 5 of 5

Thread: Custom bind allowBlank or some other config property

  1. #1
    Sencha User
    Join Date
    Mar 2011
    Location
    Arvada, CO
    Posts
    404
    Answers
    11

    Default Custom bind allowBlank or some other config property

    I'm getting confused on what config values are allowed to be bound, and which ones are not. Currently, allowBlank is not allowed to be bound, as I get an error saying Ext.mixin.Bindable.applyBind(): Cannot bind allowBlank on Ext.form.field.ComboBox - missing a setAllowBlank method. If I use a config, I don't get the error, but it doesn't work as expected:

    Code:
    xtype: 'combobox',
    anchor: '100%',
    fieldLabel: 'Affiliation',
    name: 'AffiliationId',
    displayField: 'Abbreviation',
    valueField: 'AffiliationId',
    queryMode: 'local',
    typeAhead: true,
    config: {
      forceSelection: true,
      allowBlank: false
    },
    bind: {
      store: '{affiliationStore}',
      allowBlank: '{allowBlankAffiliation}',
      forceSelection: '{forceSelectionAffiliation}'
    }
    What I'd like to know is, how can I bind allowBlank or any other property to a formula? Is this even possible, or am I totally not understanding something? And if so, how do I know what I can bind and what I can't bind?

  2. #2
    Sencha User
    Join Date
    Nov 2014
    Posts
    3,120
    Answers
    446

    Default

    Hi--

    Here is a guide on what can be bound to: https://docs.sencha.com/extjs/5.1/ap...ng_and_Configs

    Thanks!
    Joel

  3. #3
    Sencha User
    Join Date
    Mar 2011
    Location
    Arvada, CO
    Posts
    404
    Answers
    11

    Default

    RTFM. Thanks for being nicer about it Joel.

  4. #4

    Default

    [QUOTE=joel.watson;1111931]Hi--

    Here is a guide on what can be bound to: https://docs.sencha.com/extjs/5.1/ap...ng_and_Configs



    I am facing a similiar issue. I am not able to bind "regex". Giving me the same error.
    This link is not working. Please let me know how to proceed

  5. #5
    Sencha User
    Join Date
    Mar 2011
    Location
    Arvada, CO
    Posts
    404
    Answers
    11

    Default

    Quote Originally Posted by Scott Davidson View Post
    I am facing a similiar issue. I am not able to bind "regex". Giving me the same error.
    This link is not working. Please let me know how to proceed
    Hello Scott. In order to do a custom bind on a property, you would need to create your own setter. Have a look at this Fiddle for regex... you'll see that the console.log shows the bound value, and in that setter, that's where you'll do the logic for updating your field's regex:


Similar Threads

  1. Replies: 9
    Last Post: 19 Jul 2017, 12:24 PM
  2. Replies: 1
    Last Post: 6 Nov 2014, 5:33 PM
  3. Replies: 0
    Last Post: 17 Aug 2012, 4:03 AM
  4. allowBlank config property in HTMLEditor
    By jmaia in forum Sencha Ext JS Q&A
    Replies: 10
    Last Post: 6 Jun 2012, 1:30 PM

Posting Permissions

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