1. #1
    Sencha User
    Join Date
    Feb 2013
    Posts
    12
    Vote Rating
    3
    123e is on a distinguished road

      0  

    Default Unanswered: how to navigate and push data between two views?

    Unanswered: how to navigate and push data between two views?


    Hello,
    This is some what related to my previous question.

    I have Panel which has x-type data view I am populating images (thumbnail view) in data view through itemTpl of data view as follows :-
    itemTpl: [<img src = "{filepath}/{filename}"/>]

    I have attached itemTap event to this : -
    onItemTap: function(dataview,index,target,record,e,option)
    {

    var store=Ext.getStore('Store');
    store.load();


    var current_store = dataview.getStore();
    var current_data = dataview.getStore().getAt(index).getData();


    console.log('clicked - ' + current_data.xindex);


    if(current_data.xindex >= 0)
    {

    //this.up('testpanel').push({xtype:'imagecontainer'});

    I am not able to push data from this view to other view
    How to navigate/push data from this view to other ?
    (i am writing this code in itemTpl of Ext.Dataview using Sencha Architect)

    }
    else{
    Ext.Msg.alert("Opps!!!", "Something went wrong while calling data");
    }
    }

    I tried this using controller but no luck
    Can you please help me in finding out this solution Please ....
    I am using Sencha Architect for my project.

    Thanks

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,668
    Answers
    3354
    Vote Rating
    746
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    So when you pass in the config object when you push, pass in the data then.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Feb 2013
    Posts
    12
    Vote Rating
    3
    123e is on a distinguished road

      0  

    Default


    First view - shows images in thumbnail view
    Ext.define('MyApp.view.MyPanel', {
    extend: 'Ext.Panel',
    alias: 'widget.galleryview',


    config: {
    layout: {
    type: 'fit'
    },
    items: [
    {
    xtype: 'dataview',
    id: 'gallerythumbnail',
    itemId: 'mydataview',
    layout: {
    type: 'fit'
    },
    itemTpl: [
    '<div class="lb-album">',
    ' <ul>',
    ' <li>',
    ' <img src="{filename}" width="120px" heigth="120px"/>',
    ' </li>',
    ' </ul> ',
    '</div>'
    ],
    store: 'ImageStore'
    }
    ]
    }


    });

    second view
    when i tapped on image that image should be displayed on

    Ext.define('MyApp.view.FullViewPanel', {
    extend: 'Ext.Panel',


    config: {
    layout: {
    type: 'fit'
    },
    items: [
    {
    xtype: 'carousel',
    scrollable: false
    }
    ]
    }


    })

    controller:

    Ext.define('MyApp.controller.MyController', {
    extend: 'Ext.app.Controller',


    config: {
    refs: {
    nav: 'galleryview'
    },


    control: {
    "#gallerythumbnail": {
    itemtap: 'onGallerythumbnailItemTap'
    }
    }
    },


    onGallerythumbnailItemTap: function(dataview, index, target, record, e, options) {
    this.getNav().push(Ext.create('MyApp.view.FullViewPanel',{


    title:'Image'


    }));


    }


    });

    I am getting an uncaught error : push method is not defined.
    Not able to navigate from first view to second view when tapped on image . No luck
    Please help me to resolve this issue.
    Thank You .

  4. #4
    Sencha Premium Member
    Join Date
    May 2011
    Posts
    71
    Answers
    5
    Vote Rating
    6
    cyee is on a distinguished road

      0  

    Default


    Quote Originally Posted by 123e View Post
    //this.up('testpanel').push({xtype:'imagecontainer'});
    It looks like you're calling push() on a container. I think what you want to do is push the new imagecontainer to that container's items, with

    this.up('testpanel').getItems().add({xtype: 'imagecontainer'});

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar