Results 1 to 4 of 4

Thread: Add and Access custom config property on Property

  1. #1
    Sencha User =NR='s Avatar
    Join Date
    Mar 2013
    Location
    Singapore
    Posts
    115
    Answers
    2

    Default Answered: Add and Access custom config property on Property

    Hi there,

    as the title say, its supposed to be a straightforward thing.
    Most of the time we can just add custom config property in the view class, controller class and even most of the component that I've tried.

    but here come a new case of adding those custom config property on radiofields and trying to access it.
    On chrome those custom config property can still be access by: radiofieldReference.myCustomConfig

    *yeah I'm also wondering why its not accessible by using the usual automatice getter and setter property.
    but when tested on device (ipad and iphone) it doesnt work.

    Can someone help me on this ?

    Example of custom config property:

    Code:
    {xtype: 'radiofield', name: 'gender', value: 'male', label: 'male', myCustomConfig: 'ABD234-456-07' },
    {xtype: 'radiofield', name: 'gender', value: 'female', label: 'female', myCustomConfig: 'ABD234-456-08'}

    I'm working with: Sencha Touch 2.3.1
    Last edited by =NR=; 2 Jun 2014 at 9:09 PM. Reason: editing the code format

  2. that will be creating custom/composite component just for few "case by case" config property...

    i just want that property to hold data not doing anything fancy...

    okay i mistakenly choose this as the best answer.
    I meant for this reply to be the best answer

  3. #2
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    4,108
    Answers
    342

    Default

    You need to define a custom class, with Ext.define, that extends Ext.field.Radio and place 'myCustomConfig' in the config object. This will generate the setter and getter function. You can then lazy instantiate this custom xtype.
    Get more personalized support via a support subscription.

    Need more help with your app? Hire Sencha Services [email protected]

    When posting code, please use BBCode's CODE tags.

    Need to include a test case use:
    The official Sencha Fiddle

  4. #3
    Sencha Premium User
    Join Date
    May 2011
    Location
    Gainesville, FL
    Posts
    227
    Answers
    29

    Default

    Then use properties... Ext.define('YourApp.view.YourContainer', { config: { maleId: null, items: [ ... ] }, updateMaleId: function(maleId){ this.down('#maleRadio').maleId = maleId; } }); - or - var genderRadio = Ext.factory({xtype: 'radiofield', name: 'gender', value: 'male', label: 'male'}); genderRadio.maleId = 'ABD234-456-07';

  5. #4
    Sencha User =NR='s Avatar
    Join Date
    Mar 2013
    Location
    Singapore
    Posts
    115
    Answers
    2

    Default

    why am i getting vote down for this ?

Tags for this Thread

Posting Permissions

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