1. #1
    Sencha User oulenspiegel's Avatar
    Join Date
    Jan 2011
    Location
    Moscow, Russia
    Posts
    3
    Vote Rating
    0
    oulenspiegel is on a distinguished road

      0  

    Default Are there any easy way to fill NestedList with test data in SA?

    I've tried to use ArrayStore with no luck.

    Here is my model:

    Code:
    Ext.define('MyApp.model.MyModel', {
        extend: 'Ext.data.Model',
        config: {
            fields: [
                {
                    name: 'id',
                    type: 'int'
                },
                {
                    name: 'text',
                    type: 'string'
                }
            ]
        }
    });
    Store:

    Code:
    Ext.define('MyApp.store.MyArrayStore', {
        extend: 'Ext.data.Store',
        requires: [
            'MyApp.model.MyModel'
        ],
    
    
        config: {
            autoLoad: true,
            data: [
                [
                    1,
                    'text1'
                ],
                [
                    2,
                    'text2'
                ]
            ],
            model: 'MyApp.model.MyModel',
            storeId: 'MyArrayStore',
            proxy: {
                type: 'ajax',
                reader: {
                    type: 'array'
                }
            }
        }
    });
    List:

    Code:
    Ext.define('MyApp.view.MyCarousel', {
        extend: 'Ext.carousel.Carousel',
    
    
        config: {
            items: [
                {
                    xtype: 'toolbar',
                    docked: 'top',
                    title: 'Мобильная касса',
                    items: [
                        {
                            xtype: 'button',
                            docked: 'right',
                            ui: 'action-round',
                            width: 100,
                            text: 'Выход'
                        },
                        {
                            xtype: 'spacer',
                            docked: 'left',
                            width: 100
                        }
                    ]
                },
                {
                    xtype: 'toolbar',
                    docked: 'bottom',
                    title: 'Баланс: 10005 EUR'
                },
                {
                    xtype: 'container',
                    items: [
                        {
                            xtype: 'spacer',
                            height: 20
                        },
                        {
                            xtype: 'button',
                            height: 50,
                            ui: 'confirm-round',
                            text: 'Запросить PIN'
                        },
                        {
                            xtype: 'numberfield',
                            label: 'Телефон',
                            value: 79857801234
                        },
                        {
                            xtype: 'numberfield',
                            label: 'Сумма'
                        },
                        {
                            xtype: 'spacer',
                            height: 20
                        },
                        {
                            xtype: 'nestedlist',
                            store: 'MyArrayStore',
                            title: 'Список выданных PIN-кодов'
                        }
                    ]
                }
            ]
        }
    
    
    });
    In SA when I'm trying to choose store in NestedList, I can't see MyArrayStore (list is empty).
    When I'm trying to enter store name manually, everything disappears from design view until I delete the list.

    Obviously I'm doing something a wrong way, but, from my point of view, it shouldn't leads to disappearing of the whole view

    p.s. Trying to enter data directly to NestedList also failed.

  2. #2
    Sencha User
    Join Date
    Jun 2011
    Posts
    350
    Vote Rating
    1
    bharatn is on a distinguished road

      0  

    Default

    You need a tree store for nested list. I am attaching a simple nested list project. See if that helps.
    Attached Files
    Bharat Nagwani
    Sencha Designer Development Team

Thread Participants: 1

Tags for this Thread