Expanding simple example for grid of Facebook Posts

40 views
Skip to first unread message

Steven Curran

unread,
May 26, 2014, 4:54:14 PM5/26/14
to extdire...@googlegroups.com
Hi there, I am using rest fb to pull posts from a page in FB to display in a simple grid. I have created a connector class in java, and everything is wired up in spring. 

However I seem to have some problems when setting up a store to link back to the data within extjs. 

1) Added PostPanel to Viewport 'Starter.view.PostPanel'
2)  Created a posts panel

Ext.define('Starter.view.PostPanel', {
    extend: 'Ext.grid.Panel',
    alias: 'widget.postpanel',

    title: 'Posts from kitebay',
    store: 'Posts',

Note the grid displays when i comment out the store line here.....

3) Created a store Posts. 

Ext.define('Starter.store.Posts', {
    extend: 'Ext.data.Store',
    model: 'Starter.model.Post',
    autoLoad: true,
    pageSize: 25,
    remoteSort: true,
    remoteFilter: true,
    autoSync: true,
    sorters: [ {
        property: 'id',
        direction: 'ASC'
    } ]
});


4) And the model Post.

Ext.define("Starter.model.Post",
{
  extend : "Ext.data.Model"

    ,
fields: [ {
    name : "id",
    type : "string"
}, {
    name : "message",
    type : "string",
    convert : null
}],
    validations: [
        {
            type: "presence",
            field: "message"
        }
    ],
    proxy: {
        type: "direct",
        api: {
            read: "facebookConnector.getPostsExt"
        },
        reader: {
        }
    }
    
});



Running this throws an error I can see in the JS console of : 


Uncaught TypeError: Cannot read property 'buffered' of undefined

On: if (store.buffered && !store.remoteSort) {

Some googling has suggested that this is because the Store cannot be found, but I seem to have set everything up in the same way as done for the user store.

Any help would be greatly appreciated.

Thanks




Steven Curran

unread,
May 26, 2014, 5:07:06 PM5/26/14
to extdire...@googlegroups.com
It Looks like neither the Store or the Controller is instantiated in JS. 

Anyway to do this? Or is this because of the problems listed above? 

Thanks

Ralph Schaer

unread,
May 27, 2014, 1:01:40 PM5/27/14
to extdire...@googlegroups.com
Hi

Difficult to say what's wrong. How does the rest of the code looks like? Especially the code that initializes the whole application. 


--
You received this message because you are subscribed to the Google Groups "extdirectspring" group.
To unsubscribe from this group and stop receiving emails from it, send an email to extdirectspri...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Steven Curran

unread,
May 27, 2014, 1:06:49 PM5/27/14
to extdire...@googlegroups.com

Found the issue, I had not added it to the Viewport. JS file! After I done that all worked perfectly. Thanks for the great library!

You received this message because you are subscribed to a topic in the Google Groups "extdirectspring" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/extdirectspring/3hkRydrX_vs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to extdirectspri...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages