1. #1
    Sencha User
    Join Date
    May 2012
    Posts
    3
    Vote Rating
    0
    Kris-I is on a distinguished road

      0  

    Default Grid, no paging ...

    Grid, no paging ...


    Hello,

    I have this Json data and script see below. When I load my page the grid is filled in but I have a trouble with the page. The arrows are disabled and the "Page x of 1" and not "Page 1 of 2".

    10-05-2012 14-13-46.png

    Code:
    {"totalProperty":2,"success":true,
    "data":[{"Id":1,"FirstName":"AA","LastName":"BB"},
    {"Id":2,"FirstName":"CC","LastName":"DD"},
    {"Id":3,"FirstName":"EE","LastName":"FF"},
    {"Id":4,"FirstName":"GG","LastName":"HH"},
    }
    Code:
    <script type="text/javascript" language="javascript">
        $(document).ready(function () {
    
    
            Ext.define('User', {
                extend: 'Ext.data.Model',
                fields: [
                { name: 'FirstName', type: 'string' },
                { name: 'LastName', type: 'string' },
                { name: 'Email', type: 'string' }
            ]
            })
    
    
            var userStore = Ext.create('Ext.data.Store', {
                model: 'User',
                proxy: {
                    type: 'ajax',
                    url: '/Home/GetUsers',
                    reader: new Ext.data.JsonReader({
                        totalProperty: 'totalProperty',
                        root: 'data',
                        id: 'Id',
                        fields: [{
                            name: 'FirstName'
                        }, {
                            name: 'LastName'
                        }]
                    })
                },
                autoLoad: true
            });
    
    
            Ext.create('Ext.grid.Panel', {
                renderTo: 'testing',
                store: userStore,
                autoScroll: true,
                layout: 'fit',
                title: 'Users',
                width:450,
                columns: [{
                    text: 'First Name',
                    width: 225,
                    sortable: true,
                    dataIndex: 'FirstName',
                    editor: {
                        xtype: 'textfield',
                        allowBlank: false
                    }
                },
                {
                    text: 'Last Name',
                    width: 225,
                    sortable: true,
                    dataIndex: 'LastName',
                    editor: {
                        xtype: 'textfield',
                        allowBlank: false
                    }
                }],
                bbar: Ext.create('Ext.PagingToolbar', {
                    store: userStore,
                    pageSize: 3,
                    displayInfo: true,
                    displayMsg: 'Displaying topics {0} - {1} of {2}',
                    emptyMsg: "No topics to display"
                })
    
    
            });
    
    
        });
    </script>

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,653
    Vote Rating
    402
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    See if this post helps:
    http://www.sencha.com/forum/showthread.php?200998

    Regards,
    Scott.

  3. #3
    Sencha User
    Join Date
    May 2012
    Posts
    3
    Vote Rating
    0
    Kris-I is on a distinguished road

      0  

    Default


    Quote Originally Posted by scottmartin View Post
    Thanks, That's mean there is a trouble with the default template provided with ASP.NET MVC 3

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar