1. #1
    Ext GWT Premium Member
    Join Date
    Oct 2009
    Posts
    131
    Vote Rating
    5
    zlevardy is on a distinguished road

      0  

    Post Unanswered: gird paging total is 0, no next page

    Unanswered: gird paging total is 0, no next page


    hi,

    I am trying to adopt paging (ideally infinite scroll, but this stage just pure paging). Backend is spring supported, that accepts start and limit parameter, what is working fine. First page is show, but unable to get next. Stripped out all unnecessary code - I hope

    Code:
    http://localhost:8080/search.json?crit=my&start=0&limit=3
    store is having a grouping header, but that all done on server side, nothing to do on client
    Code:
    Ext.define('MyApp.store.Search',{
    	extend: 'Ext.data.Store',
    	model: 'MyApp.model.Search',
    	groupField: 'teamPrj',
    
    
    	sorters: [
    	          { property : 'teamPrj', direction: 'ASC' },
    	          { property : 'name', direction: 'ASC' }
    	],
    
    	autoLoad: true,
        remoteSort: true,
        buffered: true,
        pageSize: 100,
    
    
    	proxy: {
    		type: 'ajax',
    		url: MyApp.CONTEXT_PATH + '/search.json',
    		reader: {
                type: 'json',
                root: 'data',
                totalProperty: 'total'
            }
    	}
    
    
    
    });
    
    Ext.define('MyApp.model.Search',{
    	extend: 'Ext.data.Model',
    
    
    	fields: ['teamPrj',
    	         'isrc'
    
    ]
    
    
    });
    
    Loading the grid with its popup window, like this:
    Code:
    sParams = {crit: my};
    
    
    		                        		var store = Ext.StoreMgr.get('Search');
    
    
    		                            	Ext.Ajax.request({
    		                                    url: MyApp.CONTEXT_PATH + '/search.json',
    		                                    params: sParams,
    		                                    timeout: 3000, 
    		                                    method: 'GET',
    		                                    waitMsg: 'Searching...',
    		                                    scope: this, 
    		                                    success: function(response, opts) {
    
    
    
    
    		                                        var obj = Ext.decode(response.responseText);
    
    		                                        var store = Ext.StoreMgr.get('Search');
    		                                        if (obj.success) {
    		                                        	 console.log('total='+obj.total);
    		                                        	store.proxy.totalCount = obj.total;
    
    		                                        	store.loadData(obj.data);
    what's missing?

    thx,
    Zol

  2. #2
    Sencha User
    Join Date
    Sep 2012
    Posts
    14
    Vote Rating
    0
    dadaking is on a distinguished road

      0  

    Default


    Hello, i do a basic grid with json store:

    Grid:
    Code:
    var grid = Ext.create('Ext.grid.Panel', {
        title: 'Grid example',
        store: jsonStore,
        loadMask: true,
        columns: [
            { text: '...', dataIndex: '...' },
    	{ text: '...', dataIndex: '...' },
    	{ text: '...', dataIndex: '...' }
        ],
        bbar: Ext.create('Ext.PagingToolbar', {
    	store: jsonStore,
    	displayInfo: true,
    	displayMsg: 'Displaying topics {0} - {1} of {2}',
    	emptyMsg: "No topics to display"
        }),
    });
    Store:
    Code:
    var jsonStore = new Ext.data.JsonStore({
        storeId: 'gridStore',
        autoLoad: true,
        pageSize: 20,
        model: 'resources',
        proxy: {
            type: 'ajax',
    	url: 'http://...',
    	reader: {
    	    root: '...',
    	    totalProperty: '...'
    	}
        }
    });
    Model:
    Code:
    Ext.define('resources', {
        extend: 'Ext.data.Model',
        fields: [
    	{ name: '...',   type: '...' },
    	{ name: '...', type: '...' },
    	{ name: '...', type: '...' }
        ],
        idProperty: '...'
    });
    It's work with me, you must just replace "..." by your data (column name of your json for example)

    I hope i help you.

    Regards,
    David

  3. #3
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,912
    Answers
    655
    Vote Rating
    443
    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


    Here is an example using spring and paging:
    http://loianegroner.com/2012/05/extj...e-paging-grid/

    If this does not help, I have posted a PHP example online as well.

    Scott.

  4. #4
    Ext GWT Premium Member
    Join Date
    Oct 2009
    Posts
    131
    Vote Rating
    5
    zlevardy is on a distinguished road

      0  

    Default


    thanks Scott,

    found many small things. Rightnow I am stage, where first page loaded correct. Total value and page count looks okay. Now the problem is while clicking on Next it shows an empty screen. After some fire-bugging, it looks, my search term is not sent out - parameter: crit.
    Code:
    localhost:8080/search.json?start=100&limit=100&group=[{"property"%3A"teamPrj"%2C"direction"%3A"ASC"}]&sort=[{"property"%3A"teamPrj"%2C"direction"%3A"ASC"}]
    first page call is this:
    Code:
    http://localhost:8080/search.json?crit=my&start=0&limit=100
    Where should the gird contain the mandatory 'crit' field to be ready for re-send.

    thanks a lot,
    Zol

  5. #5
    Ext GWT Premium Member
    Join Date
    Oct 2009
    Posts
    131
    Vote Rating
    5
    zlevardy is on a distinguished road

      0  

    Default


    issue solved by adding proxy.extraParams
    store.proxy.setExtraParam('crit','my');

Thread Participants: 2

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi