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 9229745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:38:52+00:00 2026-06-18T05:38:52+00:00

I am trying to use template in a panel. The template trigger is come

  • 0

I am trying to use template in a panel. The template trigger is come from another grid item selection. But this code doesn’t work….

What is wrong with my code?
Just simple copy/paste my code to run…
Anyone, would you please fix this for me?

HTML Code:

<html>
<head>
<link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css">
<script type="text/javascript" src="extjs/ext-all-debug.js">
</script>
<script type="text/javascript">
Ext.onReady(function () {

Ext.create('Ext.data.Store',{
    storeId: 'letterStore',
    fields: ['TitleLetter','LetterType'],
    data: {
    'items': [
        { 'TitleLetter' : 'Keterangan', 'LetterType' : 'Not My Type'},
        { 'TitleLetter' : 'Dua', 'LetterType' : 'Yes This is my Type' }
    ]
    },
    proxy: {
    type: 'memory',
    reader: {
        type: 'json',
        root: 'items'
    }
    }
});


var panel = Ext.create('Ext.panel.Panel',{
    title: 'Testing',
    renderTo: Ext.getBody(),
    items: [
    {
        xtype: 'gridpanel',
        title: 'Grid For TPL',
        bodyPadding: 5,
        listeners: {
        itemclick: function(selModel, record, index, options){

            var detailPanel = this.child('#detailPanel');
            detailPanel().update(record.data);
        }
        },
        store: Ext.data.StoreManager.lookup('letterStore'),
        width: 300,
        height: 300,
        columns: [
        {
            xtype: 'gridcolumn',
            dataIndex: 'TitleLetter',
            text: 'Judul Surat'
        },
        {
            xtype: 'gridcolumn',
            dataIndex: 'LetterType',
            text: 'Tipe Surat'
        },

        ]
    },
    {
        xtype: 'panel',
        itemId: 'detailPanel',
        title: 'Show TPL',
        tpl: ['I am trying to use TPL {TitleLetter}']
    },


    ]


});



});

</script>
</head>
<body>
</body>
</html>
  • 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-06-18T05:38:54+00:00Added an answer on June 18, 2026 at 5:38 am

    Try this for your itemclick event:

    itemclick: function(selModel, record, index, options) {
        // In this function, "this" refers to the grid,
        // so you need to go up to the parent panel then
        // back down to get the detailPanel
    
        var detailPanel = this.up().down("#detailPanel");
        detailPanel.update(record.data);
    }
    

    EDIT: An even faster method that bypasses Ext.ComponentQuery entirely.

    itemclick: function(selModel, record, index, options) {
        var detailPanel = this.ownerCt.getComponent("detailPanel");
        if (detailPanel) {
            detailPanel.update(record.data);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to use this code to render a menu module on a custom template
I'm trying to use PDO in this way and reuse the output template: selected_products_show
I'm trying to use a Django template, but even thought I've used pip install,
This is the provided function template I'm trying to use: template <class Process, class
I am trying to use a template that contains a link such as this:
I'm practicing C# with wpf and I'm trying to use template formatting. At this
So I've been trying to figure out how to use template specialization but ran
I am trying to use the std::map template, but I haven't been able to
I'm going a little nuts trying to figure out how to use template inheritance
I'm trying to use coffeekup as my default template app.set 'view engine', 'coffee' app.register

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.