1. #21
    Sencha Premium Member
    Join Date
    May 2012
    Posts
    52
    Vote Rating
    11
    celticboyone will become famous soon enough

      1  

    Default


    Hi, I looked at your CurrentMoviesSpiltView project but unfortunately it is the raw files so I cannot open it on my PC (your paths etc. are different). You just need to do a "Archive Project" from the File menu when you wish to transfer projects to others (it puts all the files in a single .xda file)

    That said I can read your code. You did good but one problem is that you have no reference set in the Controller to find your movie details panel. So the onListDiclose controller action that has the line "this.getMovieDetails();" will fail because it does not have a getMovieDetails() function - when you set a ref in a controller it automatically creates a "get" function with the name of the ref. So for example, let's say you have a panel with an ID of "movieDetails". You would go to the MoviesController and in the Config add (+) a new Reference with a name of "movieDetails" and a selector of "#movieDetails". Now the controller will automatically create a "getMovieDetails() function. Don't forget to set the ID of your panel to movieDetails. Your controller code should now look like this:

    Code:
    Ext.define('Movies.controller.MoviesController', {
        extend: 'Ext.app.Controller',
        config: {
            refs: {
                moviesList: '#moviesList',
                movieDetails: '#movieDetails'
            },
            control: {
                "#moviesList": {
                    disclose: 'onListDisclose'
                }
            }
        },
        onListDisclose: function(list, record, target, index, e, options) {
            var infoPanel;
            infoPanel = this.getMovieDetails();   // Get a reference to the panel
            infoPanel.setData(record.data);  // Set the data in the panel
        }
    });
    This should move you forward a step, stay at it - you are close!

  2. #22
    Sencha User
    Join Date
    Jul 2012
    Posts
    41
    Vote Rating
    1
    tyladurdan is on a distinguished road

      0  

    Default Amazing, thanks

    Amazing, thanks


    Amazing...it now works! Thanks for taking the time to explain about the ref and the ID, I'm starting to understand the controller a bit better now!

    Now for the fun adapting it with other sources...

    :-)