1. #1
    Sencha User
    Join Date
    Jun 2008
    Posts
    11
    Answers
    1
    Vote Rating
    0
    aceman3000 is on a distinguished road

      0  

    Default Unanswered: Generate map on detailcard of nestedlist out of a store

    Unanswered: Generate map on detailcard of nestedlist out of a store


    I have a nestedlist with some items in it coming from a tree store.
    Now when i click on "So kommen Sie zu uns" i want to open a detailcard that has a map on it. The address for the map is in the store.
    All other items just open the detailcard and get the html content out of the store.

    Can i do it this way (and how?), or is there another different better approach?

    CaravansMap.png

    Here is my nestedlist:
    Code:
    Ext.define('App.view.Service', {    extend: 'Ext.dataview.NestedList',
        xtype: 'service',
        id: 'mainlist',
        
        requires: [
            'App.store.Service',
            'App.view.ServiceDetail'
        ],
        
        config: {
            title: 'Service',
            useTitleAsBackText: false,
            backText: 'Zurück',
            onItemDisclosure: true,
            store: 'Service',
            detailCard: {
                xtype: 'servicedetailcard'
            },
            zIndex: 0
        },
        
        getTitleTextTpl: function() {
            return '<div>{name}</div>';
        },
        getItemTextTpl: function(node) {
            return '<div><strong>{name}</strong></div>';
        }
    });
    Here my controller code:
    Code:
    onServiceDetailCardActivate: function(card, list) {        // Get selected leaf node
            var record = list.getLastNode();
            
            // Get and update description
            var descriptionField = card.down('#servicedescription');
           descriptionField.setHtml(record.get('description'));
          
        },
    servicedetailcard
    Code:
    Ext.define('App.view.ServiceDetail', {    extend: 'Ext.Panel',
        xtype: 'servicedetailcard',
        id: 'servicedetailcard',
        
        config: {
            scrollable: true,
            
            defaults: {
                styleHtmlContent: true
            },
            
            items: [
                {
                    id: 'servicedescription',
                    html: ''
                },
            ]
        }
    });
    store json file
    Code:
    {    "items": [
            {
                "id": 1,
                "name": "Über uns",
                "description": "<a href='#'>test</a><p>Lorem ipsum dolor sit</p>",
                "leaf": true
            },        
            {
                "id": 2,
                "name": "Was wir machen",
                "description": "Lorem ipsum dolor sit",
                "leaf": true,
            },
            {
                "id": 3,
                "name": "Werkstatt",
                "description": "<h1>Werkstatt</h1>",
                "leaf": true
            },
            {
                "id": 4,
                "name": "So kommen Sie zu uns",
                "description": "",
                "address": 'Berliner Platz 8, 48151 Münster, Germany',
                 "leaf": true
            },
        ]		
    }

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,798
    Answers
    3467
    Vote Rating
    834
    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


    If you have the detailCard provided the nestedlist should automatically go to it but do nothing more than set it as the active item. You need to listen to the leafitemtap event on the nestedlist to take action when a leaf has been tapped on. The nestedlist example that comes with ST2 shows this.
    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
    Jun 2008
    Posts
    11
    Answers
    1
    Vote Rating
    0
    aceman3000 is on a distinguished road

      0  

    Default


    Thanks for your answer Mitchell, but i don´t know what to do now.
    My list is working and shows detailcards for every item. I update the contents with
    Code:
    serviceDetailCard: {
                    activate: 'onServiceDetailCardActivate'
                },
    
    
    onServiceDetailCardActivate: function(card, list) {        // this needs work. Display a map when no content is given.
            // address should come out of store
            // Get selected leaf node
            var record = list.getLastNode();
            
            // Get and update description
            var descriptionField = card.down('#servicedescription');
             descriptionField.setHtml(record.get('description'));
        },
    So i need to change the event to leafitemtap? And then? How to add an xmap only to the fourth item of my store? I hope someone can help.

  4. #4
    Sencha User bluehipy's Avatar
    Join Date
    Mar 2010
    Location
    Romania
    Posts
    606
    Answers
    66
    Vote Rating
    26
    bluehipy will become famous soon enough bluehipy will become famous soon enough

      0  

    Default


    If
    current record . get( 'address' ) !== ''
    Then
    container add {xtype:'map'}




    To se the address and center the view. read docs and docs
    http://docs.sencha.com/touch/2-0/#!/...cfg-mapOptions
    https://developers.google.com/maps/d...dressComponent

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi