Results 1 to 5 of 5

Thread: Passing parameters

  1. #1
    Sencha User
    Join Date
    Oct 2015
    Posts
    37
    Answers
    1

    Default Answered: Passing parameters

    Hey,

    I'm trying to pass parameters, but with no luck. Anyone could put me on a right road?

    Code:
    Ext.define('MyWeb.view.BaseClass', {
        extend: 'Ext.container.Container',
    
      myCustomField: '',
    
      someAction: function()
      {
            console.log(this.myCustomField);
       }
    
    });
    Code:
    Ext.define('MyWeb.view.SubClass', {
        extend: 'MyWeb.view.BaseClass',
    
      myCustomField: 'data'
    
    });

    At the moment, I get this result:
    myCustomField undefined


    All sugeestions or ideas will be appreciated!

  2. You define customField in container, but calls this property from child button.

    You can check this by replacing:
    Code:
    this.customField
    by
    Code:
    this.ownerCt.customField
    and off course
    Code:
    this.setText();
    by
    Code:
    this.setText(this.ownerCt.customField);

  3. #2
    Sencha Premium Member
    Join Date
    Mar 2015
    Location
    Germany
    Posts
    294
    Answers
    30

    Default

    Hi, the question is where do you call someAction ? Could you provide a fiddle with the problem.

  4. #3
    Sencha User
    Join Date
    Oct 2015
    Posts
    37
    Answers
    1

    Default

    Sure, button should change it's text to S:

    https://fiddle.sencha.com/#fiddle/13l7

  5. #4
    Sencha Premium Member
    Join Date
    Mar 2015
    Location
    Germany
    Posts
    294
    Answers
    30

    Default

    You define customField in container, but calls this property from child button.

    You can check this by replacing:
    Code:
    this.customField
    by
    Code:
    this.ownerCt.customField
    and off course
    Code:
    this.setText();
    by
    Code:
    this.setText(this.ownerCt.customField);

  6. #5
    Sencha User
    Join Date
    Oct 2015
    Posts
    37
    Answers
    1

    Default

    Big thanks!

Similar Threads

  1. regarding passing parameters
    By nmohan.025 in forum Ext 3.x: Help & Discussion
    Replies: 8
    Last Post: 2 Sep 2010, 3:38 AM
  2. Passing parameters..
    By riets003 in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 13 Sep 2009, 11:24 PM
  3. passing parameters to a new class
    By archmisha in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 19 Oct 2008, 5:01 PM
  4. Passing parameters through a window
    By Nexcet in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 4 Sep 2008, 2:00 PM
  5. Passing parameters to C# web service
    By gargamel4670 in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 13 Mar 2008, 5: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
  •