Fares Omrani
Fares Omrani

Reputation: 255

Grid in sencha touch 2

I'm new in Sencha touch and i like to integrate a grid in my application by editing app.js file This is the contain of app.js

 Ext.application({
name: 'Sencha',

launch: function() {

    Ext.create('Ext.data.TreeStore', {
        storeId: 'TreeStore',
        fields: ['title', 'link', 'author', 'contentSnippet', 'content', {
            name: 'leaf',
            defaultValue: true
        }],
        root: {
            leaf: false
        },
        proxy: {
            type: 'jsonp',
            url: 'https://ajax.googleapis.com/ajax/services/feed/load?v=1.0&q=http://feeds.feedburner.com/SenchaBlog',
            reader: {
                type: 'json',
                rootProperty: 'responseData.feed.entries'
            }
        }
    });     
    Ext.create("Ext.tab.Panel", {
        fullscreen: true,
        tabBarPosition: 'bottom',

        items: [
            {
                xtype: 'nestedlist',
                title: 'Menu 1',
                iconCls: 'star',
                displayField: 'title',

                store: 'TreeStore',

                detailCard: {
                    xtype: 'panel',
                    scrollable: true,
                    styleHtmlContent: true
                },

                listeners: {
                    itemtap: function(nestedList, list, index, element, post) {
                        this.getDetailCard().setHtml(post.get('content'));
                    }
                }
            },
            {
                xtype: 'grid',
                title: 'GRID',
                requires: ['Ext.grid.Grid',
                   'Ext.grid.HeaderGroup',
                   'Ext.grid.plugin.Editable',
                   'Ext.grid.plugin.ViewOptions',
                   'Ext.grid.plugin.MultiSelection',
                   'Ext.grid.plugin.ColumnResizing',
                   'Ext.grid.plugin.SummaryRow'
                  ]
            }
        ]
    });
}

});

it shows me an error 'Uncaught Error: [Ext.createByAlias] Cannot create an instance of unrecognized alias: widget.grid' Is there a way to correcte these error or my step is wrong ?

Thank you in advance

Upvotes: 0

Views: 508

Answers (2)

Manjappa
Manjappa

Reputation: 21

take a look at

https://github.com/swluken/TouchTreeGrid

it might be helpful, I used in my project.

as above said Sencha Touch Grid is only available in the Sencha Touch Complete (paid) product so it is not available in your 'toch' directory,therefore when you try load 'Ext.grid.Grid' it throws error

any doubt.. feel free to ask.

Upvotes: 1

OhmzTech
OhmzTech

Reputation: 897

Sencha Touch Grid is only available in the Sencha Touch Complete (paid) product. If you haven't purchased Sencha Touch Complete, then the grid component is not available. If you do have the Touch Complete SDK, then it's probably an issue with your requires. Requires should not be within a items: [] config, it should be a requires at the top of the class/file. In the case of your code example, it would be under the app configuration itself.

Upvotes: 2

Related Questions