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

  • Home
  • SEARCH
  • 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 8094639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:51:26+00:00 2026-06-05T20:51:26+00:00

Inside my Controller i have function that runs after user clicks on item, which

  • 0

Inside my Controller i have function that runs after user clicks on item, which loads a store and creates/populates TabPanel with DataView (it works). When user clicks on only one specified item (if clause) i want to split store and create 2 panels with 2 DataViews. How can i pass custom parameter (record.data.name) to store listener so i could check which item was clicked? Or maybe there is different method to achieve what i want? Here is code of my Controller:

init: function() {
    this.control({
        'gallery_menu': {
            itemclick: this.show_gallery
        }
    });
},
imageStoreLoaded: function(ImageStore, store1, store2) {


},
show_gallery: function(view, record, item, index, e, opts) {


    Ext.getCmp('hania-viewport').setLoading('Loading data...');

    var tabb = Ext.ComponentQuery.query('.gallery_panel');

    var ImageStore = Ext.create('Gallery.store.Images');

    ImageStore.load({url: 'myphoto/index.php/api/feed/json/' + record.data.uuid});

    var gallery_view;

    if (record.data.name == 'Specified_item1') {
        var store1 = Ext.create('Gallery.store.Images');
        var store2 = Ext.create('Gallery.store.Images');

        //THIS WONT WORK - STORE IS NOT LOADED YET;
        ImageStore.each(function(r) {
                if (r.data.name.substring(0, 2) == 'PS') {
                    console.log('PS');
                    store1.add(r.copy());
                }else{
                    console.log('NOT PS');
                    store2.add(r.copy());
                }               
        });

        //IF I ADD LISTENER HOW CAN I RETURN/REFERENCE store1, store2 ???
        //OR how can i pass record.data.name so i could check which item was clicked?   
        ImageStore.addListener('load',this.imageStoreLoaded, this);

        var panel1 = Ext.widget('gallery_view', {
            title: 'xxx',
            autoScroll: true,
            store: store1,
            flex: 1
        });


        var panel2 = Ext.widget('gallery_view', {
            title: 'yyy',
            autoScroll: true,
            store: store2,
            flex: 2
        });

        gallery_view = Ext.create('Ext.panel.Panel',{
            id: record.data.uuid,
            title: 'abc',
            layout: {                   
                type: 'hbox',
                pack: 'start',
                align: 'stretch'
            },
            closable: true,
            autoScroll: true,
            items: [panel1, panel2]
        });

    }else{

        gallery_view = Ext.widget('gallery_view', {
            title: record.data.name + ' - Photo Gallery',
            id: record.data.uuid,
            closable:true,
            scrollable:true,
            autoScroll: true,
            store: ImageStore
        });
    }

     if (tabb[0].down('#' + record.data.uuid)) {
        tabb[0].setActiveTab(record.data.uuid);
     }else{
        tabb[0].add(gallery_view);
        tabb[0].setActiveTab(gallery_view);
     };

}
  • 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-05T20:51:27+00:00Added an answer on June 5, 2026 at 8:51 pm
    And the code:
    
    
    show_gallery: function(view, record, item, index, e, opts) {
    
    
        Ext.getCmp('hania-viewport').setLoading('Loading data...');
    
        var tabb = Ext.ComponentQuery.query('.gallery_panel');
    
        var ImageStore = Ext.create('Gallery.store.Images');
    
        ImageStore.load({url: 'myphoto/index.php/api/feed/json/' + record.data.uuid});
    
        var gallery_view;
    
        if (record.data.name == 'Do kogo jestem podobna?') {
            var store1 = Ext.create('Gallery.store.Images');
            var store2 = Ext.create('Gallery.store.Images');
    
            function doStuff() {
    
                console.log(ImageStore);
    
                ImageStore.each(function(r) {
                    if (r.data.raw_name.substring(0, 2) == 'PS') {
                        console.log('PS');
                        store1.add(r.copy());
                    }else{
                        console.log('NOT PS');
                        store2.add(r.copy());
                    }               
                });
    
                console.log(store1); 
                console.log(store2);
            }
    
    
            ImageStore.addListener('load',doStuff, this);
    
            var view1 = Ext.widget('gallery_view', {
                title: 'xxx',
                store: store1,
                flex: 1
            });
    
            var panel1 = Ext.create('Ext.panel.Panel',{
                title: 'Tata',
                items: view1,
                flex: 1
            });
    
            var view2 = Ext.widget('gallery_view', {
                //autoScroll: true,
                store: store2,
                flex: 1
            });
    
            var panel2 = Ext.create('Ext.panel.Panel',{
                title: 'Mama',
                items: view2,
                flex: 1
            });
    
            gallery_view = Ext.create('Ext.panel.Panel',{
                id: record.data.uuid,
                title: 'Do kogo jestem podobna?',
                width: 800,
                bodyStyle: 'padding: 25px;',
                layout: {                   
                    type: 'hbox',
                    pack: 'start',
                    align: 'stretch'
                },
                closable: true,
                autoScroll: true,
                items: [panel1, panel2]
            });
    
        }else{
    
            gallery_view = Ext.widget('gallery_view', {
                title: record.data.name + ' - Photo Gallery',
                id: record.data.uuid,
                closable:true,
                scrollable:true,
                autoScroll: true,
                store: ImageStore
            });
        }
    
         if (tabb[0].down('#' + record.data.uuid)) {
            tabb[0].setActiveTab(record.data.uuid);
         }else{
            tabb[0].add(gallery_view);
            tabb[0].setActiveTab(gallery_view);
         };
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a View Controller inside my MainWindow.xib file that loads the nib Cover
I have a few methods inside my view controller that load up for future
i have a controller with multiple functions that have a variable inside them. I
I have the following function inside my HomeController class: public class HomeController : Controller
I have a Controller named Author . Inside the controller, I have defined a
I have controller PlayerController and actions inside: View , Info , List . So
I have some code inside a controller called AdminController. public ActionResult Login() { AdminModel
I have a tab bar controller with a view inside a navigation controller. One
I have 4 UIBarButtonItems inside a UISplitViewController's right hand side (the detail controller). I'm
Solution is called Portal which holds Areas/CMS/Login folder inside it. Login controller in CMS/Controllers

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.