Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7591735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:43:30+00:00 2026-05-30T20:43:30+00:00

I am new to extjs and I am having trouble when feeding a template

  • 0

I am new to extjs and I am having trouble when feeding a template with data.

var header = new Ext.Template("<div><b>{name}</b></div>");
header.compile();

var description = new Ext.Template("<div><b>{description}</b></div>");
description.compile();

Ext.define('ActivityWindow', {
    extend   : 'Ext.window.Window',
    id   : 'detActWin',
    layout   : 'border',
    config   :{
        resultRecord : null
    },
    defaults :{
        xtype   : 'panel'
    },
    constructor: function (args){
        this.initConfig(args);
        this.callParent();
    },
    items    : [
            {
                tpl : header,
                itemId  : 'activityHeader',
                region  : 'north',
                data    : this.resultRecord
            },
            {
                html    : 'partecipantsList',
                itemId  : 'activityPartecipants',
                region  : 'east'
            },
            {
                html    : 'description',
                region  : 'center'
            }               
    ]       

});

    var winDetAct = Ext.create(ActivityWindow, { resultRecord: entry});
    alert(winDetAct.getResultRecord().get('name')); //it shows the field name
    winDetAct.show();

where resultRecord = {name : ‘topText’, description: ‘rightText’}

I would like to pass this resultRecord to the Window class and have the items using this data. the resultRecord in the window class is well set, because the alert shows the correct data.

but this line is like ignored,

    data    : this.resultRecord

questions:

1 – How can I feed the template in item 1 of the window with the data from the variable resultRecord ?

2 – Is there a proper way to do this?

thank you very much,
Gabriel

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T20:43:31+00:00Added an answer on May 30, 2026 at 8:43 pm

    The issue you are seeing is that this.resultRecord is undefined because “this” context is not yet available as the component to your config. You have to call initComponent and inside that you can have this.Myproperty reference. Her is your code modified to work correctly:
    http://jsfiddle.net/dbrin/HTAWP/1/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

// Using extjs 3.x var box = new Ext.Textfield { /* textField configuration */
I am creating a new ExtJS widget using Ext.view.View. The template for this view
im pretty new to extjs and having trouble with it i am using the
I have an ExtJS grid like so: var grid = new Ext.grid.GridPanel({ ... });
I'm having trouble when I try to create a new object in ExtJS. First
I'm using ExtJS to create a formPanel: new Ext.FormPanel({ labelAlign: 'top', title: 'Loading Contact...',
In my ExtJS application I use EditorGridPanel to show data from server. var applicationsGrid
I'm working with extjs 2.2.1, having a bit of a trouble adding a button
I'm using ExtJS 4.0.7, am new to Ext, and am using the new MVC
I am new to ExtJS and have written a sample App using Ext.application with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.