ドロップダウンリストから値を選択して、リストを動的に入力する必要があります。
たとえば、[アクティブなレコード] を選択すると、アクティブなレコードがリストに入力されます。[レコードの削除]を選択すると、削除されたレコードがリストに入力されます。
以下の私のコードを見てください
Model.js
Ext.define('bluebutton.model.BlueButton.TransactionList', {
extend: 'Ext.data.Model',
config: {
idProperty:'transactionId',
// id:'transactionlistmodel',
fields: [
{ name: "transactionId" ,type:"string" },
{ name: "merchant_bbID" ,type:"string" },
{ name: "sessionId" ,type:"string"},
{ name: "deviceId" ,type:"string"},
{ name: "createDateTime" ,type:"string"},
{ name: "fullName" ,type:"string"},
{ name: "action" ,type:"string"},
{ name: "updatedPoint" ,type:"string"},
{ name: "createDate" ,type:"string"},
{ name: "status",type:"string" },
],
proxy: {
type: 'rest',
url: 'http://localhost:8080/WebCommon/rest/BBWebService/getPointTransactionList',
// url: 'http://mixsoloffice.no-ip.biz:82/WebCommon/rest/BBWebService/getPointTransactionList',
actionMethods: {
create: 'POST',
read: 'GET',
update: 'PUT',
destroy: 'DELETE'
},
// noCache: false, // get rid of the '_dc' url parameter
extraParams: {
sessionId: "1",
deviceId: "1",
merchant_bbID: "merchant1",
filterType :"0"
// add as many as you need
},
reader: {
type: 'json',
rootProperty: 'pointTransHistoryList',
totalProperty: 'totalRecord',
successProperty: 'success',
},
writer: {
type: 'json',
},
}
}
});
Store.js
Ext.define('bluebutton.store.BlueButton.TransactionList', {
extend: 'Ext.data.Store',
requires: [
'bluebutton.model.BlueButton.TransactionList'
],
config: {
grouper: {
groupFn: function (record) {
return record.get('createDateTime');
}
},
model: 'bluebutton.model.BlueButton.TransactionList',
pageSize: 5,
autoLoad: true,
storeId: 'transactionliststore',
sorters: 'createDateTime',
groupDir: 'DESC',
autoSync: true,
clearOnPageLoad: false,
}
});
view.js
Ext.define('bluebutton.view.BlueButton.TransactionList', {
extend: 'Ext.List',
xtype: 'transactionlistcard',
requires: [
'Ext.field.Select',
'Ext.field.Search',
'Ext.plugin.ListPaging',
'Ext.plugin.PullRefresh',
'bluebutton.store.BlueButton.TransactionList',
],
config: {
styleHtmlContent: true,
scrollable: {
direction: 'vertical',
directionLock: true
},
singleSelect: true,
grouped: true,
variableHeights : false,
store : { xclass : 'bluebutton.store.BlueButton.TransactionList'},
itemHeight :100,
loadingText : 'loading',
id :'transactionlist',
masked: {
xtype: 'loadmask',
message: 'loading...'
}, // masked
plugins: [
{
xclass: 'Ext.plugin.PullRefresh',
pullRefreshText: 'Pull down for more new Tweets!',
// refreshFn: function(callback, plugin) {
// var store = plugin.list.getStore();
// store.load(function(records, operation, success) {
// callback.call(plugin);
// console.log( records );
// });
// }
},
{
xclass: 'Ext.plugin.ListPaging',
//
}
],
emptyText: '<p class="no-search-results">No Transaction record found matching that search</p>',
itemTpl: Ext.create(
'Ext.XTemplate',
'<div class="tweet-wrapper">',
'<table>',
'<tr>',
'<td rowspan="2" width="28%" >',
// '<div style="padding-left: 30px;">',
// ' <img src="{imgUrl}" width="140" height="130" /></div>',
'</td>',
'<td>',
' <div class="tweet">',
' <h3>Transaction ID: {transactionId} , Point: {updatedPoint} pts , Action: {action}</h3>',
' <h3>Status: {status}, Transaction By: {fullName} , Transaction Date: {createDateTime}</h3>',
' </div>',
'</td>',
'</tr>',
'</table>',
'</div>'
),
listeners: {
updatedata: function (me, newData, eOpts ) {
alert(newData)
}
},
},
});
Controller.js
onTransactionStatusChange: function (selectField, value) {
var sto = Ext.getCmp('transactionlist').getStore();
sto.removeAll();
sto.sync()
var thelist = this.getTransactionlist();
thelist.setStore(sto);
sto.load({
params:{
filterType : value,
sessionId :'1',
merchant_bbID:'merchant1',
page:'1',
start:'0',
limit:'5'
}
});
},
今、私は問題に直面しています。
アクティブな リストで、現在のページがページ 2 であり、ロードされたレコードが表示されていないとしましょう 。しかし、リストを削除するように変更すると、リストにもno more record loaded が表示されます。ドロップダウン リストから値を選択したときにページングをリセットするにはどうすればよいですか