0

Json 応答を取得するためにサーバーに送信する必要がある startdate、enddate、および name の 3 つのパラメーターがあります。GridPanel に応答を表示しています。

私のAjaxリクエストは次のようになります。

FilterOperSet: function(button){
var win = button.up('window');
var form = win.down('form');
var start = form.getForm().findField('startDate').getSubmitValue();
var end = form.getForm().findField('endDate').getSubmitValue();
var act = form.getForm().findField('actor').getSubmitValue();
Ext.Ajax.request({ 
url: 'ListData',
params: { type: 'recordedRequest', startDate: start,
                 endDate: end, actor: act, start:0,limit:10 },

success: function(response) { 
var json = Ext.decode(response.responseText);
var mystore = Ext.data.StoreManager.lookup('RecordedRequestStore');
mystore.loadData(json.recordedRequests);
           }, 
           scope: this});
}

ボタンがあります。ユーザーが開始日、終了日、名前の値を入力してボタンをクリックすると、上記のリスナーがページングの開始と制限とともにそれらをパラメーターとして送信し、応答がキャプチャされてグリッドパネルに保存されます。

ページングツールバーに関する私の問題は次のとおりです。応答として次のように表示されます

recordedRequests
     // has some meta data here 

success
true

total
1339

しかし、ページング ツールバーには 1 ページしか表示されず、下部には 0 of 0 と表示され、右側には何も表示されません。実際、それは 1/14 と表示され、次のページに進むことができるはずです。

2)また、更新ボタンをクリックすると、ストアが呼び出され、サーバーが呼び出されますが、開始日、終了日、および名前をパラメーターとして使用してajaxリクエストを作成したい(これは、リスナーの上のボタンが行うこととまったく同じです)

私の店はこのように見えます:

autoLoad: false, remoteFilter: true, buffered: false, pageSize: 10, //leadingBufferZone: 1000,

fields:['start', 'end', 'actor','serviceOp'],

proxy: {
    type: 'ajax',
    url: 'ListData',
    store: 'RecordedRequestStore',
    startParam:'start',
    limitParam:'limit',
    pageParam:'page',
    reader: {
        type: 'json',
        root: 'recordedRequests',
        successProperty: 'success',
        totalProperty: 'total'
    },

    extraParams: {  
        'type': 'recordedRequest',
    }, 

    //sends single sort as multi parameter
    simpleSortMode: true,

    // Parameter name to send filtering information in
    filterParam: 'query',

    // The PHP script just use query=<whatever>
    encodeFilters: function(filters) {
        return filters[0].value;
    }
},

listeners: {
    filterchange: function(store, filters, options){
        console.log( filters )
    },

    totalcountchange: function() {
        console.log('update count: ')
        //this.down('#status').update({count: store.getTotalCount()});
    }
}

どんな種類の助けでも、私にとって大きな価値があります。前もって感謝します。

4

1 に答える 1

0

Ajax リクエストの代わりに。私は使うべきです

store.load(params{あなたのパラメーター})

nextpage と previouspage では、カスタム パラメータに beforeload リスナーを使用しました。

于 2013-12-16T20:22:05.400 に答える