Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User
    Join Date
    Jun 2010
    Posts
    4
    Vote Rating
    0
    dasblogt is on a distinguished road

      0  

    Default Unanswered: NestedList with TreeStore and JSON doesn't show up

    Unanswered: NestedList with TreeStore and JSON doesn't show up


    Hey everyone,

    I am trying to get NestedLists to work with a JSON response. I am quite new to Sencha (started yesterday) so I followed the Getting started guide and think that I setup everything correctly, but the NestedList is not showing any items. I tried searching the forum and Google, but did not find anything useful.

    The strange thing is, that my store seems to get populated with the data, because when I add the event listener load to my view I can log them. The other strange thing is, that the nested data set seems to be wrong, because there are no children attached to my model.

    Oh, totally forget what I am trying to build (everything is on Github - https://github.com/herrkris/blueMobile). It is a mobile app for a forum, so it is easier to browse and stuff. The JSON structure is in the php folder and it is kinda messed up, because the original API is plain XML and I read that the parser may be buggy so I converted it to JSON to be on the safe site, but still no items in my NestedList and still no nested data. I am not sure what I am missing and I think I tried everything the forum and Google came up with, but still no luck. Hope someone can help me :)

    I am not quite sure wether the structure is okay or totally dump. I started with the Getting Started Guide and built my own stuff around the basic structure, hope it is okay to follow along!

  2. #2
    Sencha User
    Join Date
    Jun 2010
    Posts
    4
    Vote Rating
    0
    dasblogt is on a distinguished road

      0  

    Default


    Okay, I got it to work with a simple list and a normal store.

    Nested data still doesn't work ...
    The list gets filled with the category names, but the items don't have any sub items, so the hasMany relation does not seem to work correctly, but I have no clue what I am doing wrong ...

    So here is my basic json structure:

    Code:
    {    "categories": {
            "category": [
                {
                    "@id": "6",
                    "name": "Allgemeines",
                    "description": "Seitenübergreifende Themen",
                    "boards": {
                        "board": [
                            {
                                "@id": "95",
                                "name": "3DSupply.de",
                                "description": "Alles rund um 3D Supply"
                            },
                            {
                                "@id": "69",
                                "name": "MTA-Lan",
                                "description": "Lanparty im Feriendorf"
                            }
                        ]
                    }
                },
                {
                    "@id": "7",
                    "name": "Counter-Strike / Half-Life 2",
                    "description": "Alles rund um Valves Spiele",
                    "boards": {
                        "board": [
                            {
                                "@id": "18",
                                "name": "Hauptforum",
                                "description": "Alles rund ums Thema Counter-Strike!"
                            },
                            {
                                "@id": "19",
                                "name": "CS-Help",
                                "description": "Sorgen und Nöte mit CS?"
                            }
                        ]
                    }
                }
            ]
        }
    }
    store.Category
    Code:
    Ext.define('blueMobile.store.Category', {    extend: 'Ext.data.Store',
        requires: ['blueMobile.model.Category'],
    
    
        config: {
            autoLoad: true,
            model: 'blueMobile.model.Category',
            storeId: 'Category',
    
    
            proxy: {
                type: 'ajax',
                url: '/php/boards.json',
                reader: {
                    type: 'json',
                    rootProperty: 'categories.category'
                }
            }
        }
    });
    model.Category
    Code:
    Ext.define('blueMobile.model.Category', {    extend: 'Ext.data.Model',
    
    
        config: {
            fields: [
                { name: 'id', mapping: '@id' },
                'name',
                'description'
            ],
    
    
            hasMany: {
                associatedModel: 'blueMobile.model.Board',
                
            }
        }
    });
    model.Board
    Code:
    Ext.define('blueMobile.model.Board', {    extend: 'Ext.data.Model',
    
    
        config: {
            fields: [
                { name: 'id', mapping: '@id' },
                'name',
                'description'
            ],
    
    
            proxy: {
                reader: {
                    type: 'json',
                    rootProperty: 'boards.board'
                }
            },
    
    
            belongsTo: 'Category'
        }
    });

Tags for this Thread