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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T22:47:59+00:00 2026-05-28T22:47:59+00:00

I’ve seen quite a few examples of a sencha touch app with a nestedList

  • 0

I’ve seen quite a few examples of a sencha touch app with a nestedList that creates a view within the getDetailCard method and all of that works fine. BUT I have not seen this implemented in an MVC setup. More specifically, a splitview MVC app where the nestedList is docked to the left and the detail pane to the right.

I can use setActiveItem to display a fullscreen detail view with the relevant data all day but when doing so, the left docked nestedlist is removed. How do I keep the split-view setup and update the detailView?

Controller: Products.js

/**
 * @class Products
 * @extends Ext.Controller
 */
Ext.regController('Products', {

    // index action
    index: function(){
        if ( ! this.indexView){
            this.indexView = this.render({
                xtype: 'ProductIndex',
            });
        }
        this.application.viewport.setActiveItem(this.indexView);
    },
    detail: function(options){
        var record = options.params[0].attributes.record.data;
        console.log(record);

        if ( ! this.detailView){
            this.detailView = this.render({
                xtype: 'ProductDetail',
                //data: record
            });
            //var detailsView =  this.indexView.query('#detailsView')[0];
            this.detailView.update(record);
        }       
        //this.application.viewport.setActiveItem(this.detailView, options.animation);
    }
});

Model: Product.js

Ext.regModel('Product', {
    fields: [
        {name: "id", type: "int"},
        {name: "pid", type: "int"},
        {name: "type", type: "string"},
        {name: "status", type: "string"},
        {name: "title", type: "string"},
        {name: "content", type: "auto"},
        {name: "date", type: "string"},
        {name: "modified", type: "string"}  
    ]
});


MVCApp.ProductStore = new Ext.data.TreeStore({
    model: 'Product',
    autoLoad: true,
    storeId: 'ProductStore',
    proxy: {
        type: 'ajax',
        id: 'ProductStore',
        url: 'data/nestedProducts.json',
        reader: {
            type: 'tree',
            root: 'items'
        }
    }
});

View: ProductIndexView.js

KCI.views.ProductIndex = Ext.extend(Ext.Panel, {
    layout: 'hbox',
    dockedItems: [
        {
            dock: 'left',
            xtype: 'nestedlist',
            width: '320',
            height: '100%',
            store: 'ProductStore',
            displayField: 'title',
            useToolbar: Ext.is.Phone ? false : true,
                getDetailCard : function(record, parentRecord){
                  Ext.dispatch({ 
                       controller : 'Products',
                       action     : 'detail',
                       historyUrl : 'Products/index',
                       params : [record, parentRecord]
                  });
             }
          }
    ],
    items: [
        {
            xtype: 'ProductDetail',
            itemId: 'detailView',
            width: "704",
            height: '100%'
          }
    ]
});
Ext.reg('ProductIndex', KCI.views.ProductIndex);

View: ProductDetailView.js

KCI.views.ProductDetail = Ext.extend(Ext.Panel, {
    scroll: 'vertical',
    styleHtmlContent: true,
    background: '#464646',
    html: '<h1>Product Detail</h1>',
    tpl: ['{title}<br />{id}<br />{pid}<br />{leaf}<br />{date}<br />{modified}<br />{type}<br />{status}<div>{content}</div>']
});
Ext.reg('ProductDetail', KCI.views.ProductDetail);
  • 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-28T22:48:00+00:00Added an answer on May 28, 2026 at 10:48 pm

    I have the answer, this will slide the detail card out, update it and slide it back in.

    In my Products controller, I needed to alter my detail view:

    detail: function(options)
    {
        this.currentItem = options.params[0].attributes.record.data;
        var rightPanel = this.application.viewport.query('#rightPanel')[0];
    
        if ( ! this.detailView)
        {
            this.detailView =  this.indexView.query('#detailView')[0];
            this.dummyView =  this.indexView.query('#dummyView')[0];
    
            this.dummyView.on('activate', function()
            {
                this.detailView.update(this.currentItem);
    
                rightPanel.setActiveItem(this.detailView, {type: 'slide'});
            }, this);
        }
    
        rightPanel.setActiveItem(this.dummyView, {type: 'slide', reverse: true});
    }
    

    Then in my Product Index view, create a sub panel and a dummyview:

    var rightPanel = new Ext.Panel({
        layout: 'card',
        xtype: 'rightPanel',
        itemId: 'rightPanel',
        items: [
            {
                xtype: 'ProductDetail',
                itemId: 'detailView',
                width: "704",
                height: '100%',
                html: 'right panel'
            },
            {
                itemId: 'dummyView'
            }
        ]
    });
    

    EDIT: Wanted to reference my source, and highly talented ST dev: CAM

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
We're building an app, our first using Rails 3, and we're having to build
I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;
I need a function that will clean a strings' special characters. I do NOT
I am writing an app with both english and french support. The app requests
I'm trying to create an if statement in PHP that prevents a single post

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.