Results 1 to 2 of 2

Thread: how to access constructor variables in components

  1. #1

    Default how to access constructor variables in components

    Hey Friends

    I have a class where i am passing a parameter is constructor and according to this perimeter i want to make a textfield read only or editable .

    This is how constructor function will look like for now i have hard coded val parameter .

    Code:
    isNew : false,    
    constructor: function(val =true) {
          if(val){
            isNew = val ;
          }
          this.callParent();
        },
    This is one of many components where i want to use this variable but i am not getting the value of variable

    Code:
      {
                        xtype: 'textfield',
                        required: true,
                        colspan: 1,
                        readOnly : this.isNew ,
                        fieldLabel: 'Project ID',
                        name: 'ProjectID'
                        
           },

  2. #2
    Sencha Premium User danguba's Avatar
    Join Date
    Feb 2009
    Location
    Kragujevac, Serbia
    Posts
    434

    Default

    Please share more code. Preferably whole class in a fiddle https://fiddle.sencha.com/. This looks wrong on many levels.
    All Best
    ---
    Željko Mitrović
    http://skitanja.blogspot.com/

    "Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." Martin Golding

Similar Threads

  1. Cant access global Variables in build
    By johnoskin in forum Sencha Touch 2.x: Discussion
    Replies: 1
    Last Post: 4 Nov 2014, 11:49 PM
  2. How to access singleton variables (Sencha 2.1)
    By talwinder in forum Sencha Touch 2.x: Q&A
    Replies: 2
    Last Post: 11 Jan 2013, 1:05 PM
  3. Sencha Touch 2.X Global Variables - Everywhere access
    By Ricardo Perre in forum Sencha Touch 2.x: Q&A
    Replies: 8
    Last Post: 20 Dec 2012, 7:30 PM
  4. Scope/access variables ?
    By muncher in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 8 Jul 2010, 6:40 PM
  5. How to access variables from remote loaded components and scripts?
    By ivanatora in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 26 Feb 2010, 11:55 PM

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
  •