에 그리드에 바닥 글을 추가하는 방법이 PurchaseReport.js으로 내보기 부분입니다는 엽차
Ext.define("App.view.tabs.PurchaseReport", {
extend: "Ext.panel.Panel",
alias: "widget.PurchaseReportTab",
requires: [
"App.model.PurchaseReport", "Ext.toolbar.Toolbar"
],
border: false,
layout: "fit",
items: [
App.Util.buildBrowseConfig({}, {
controller: "PurchaseReport",
primaryKeyField: "PurchaseReportId",
stateful: true,
stateId: "App.view.windows.PurchaseReport-grid",
columns: [
{ dataIndex: "PurchaseCost", filter: true, header: "Purchase Cost", width: 150 }
],
features: [{ ftype: "filters", autoReload: false, local: true }],
store: { model: "App.model.PurchaseReport", sorters: [{ property: "Name", direction: "asc" }] }
})
]
});
내 컨트롤러 파트는 내 눈금이 PurchaseReport.js로 바인딩됩니다. 그래서 여기를 변경해야합니까?
Ext.define("App.controller.tabs.PurchaseReport", {
extend: "Ext.ux.app.BrowseController",
views: ["tabs.PurchaseReport"],
refs: [
{
ref: "myPurchaseReportGrid",
selector: "PurchaseReportTab > gridpanel"
}
],
init: function() {
this.control({
PurchaseReportTab: {
bind: function (a, c) {
**//Grid bind start**
var b = this.getMyPurchaseReportGrid();
b.getSelectionModel().deselectAll();
b.store.removeAll();
b.fireEvent("bind", b, c)
**//Grid bind End**
**//Combobox Bind start**
var combo = this.getCoachCombo(),
store = combo.store,
options = store.lastOptions || {};
options = Ext.apply({
callback: function() {
combo.select(App.coach.CoachId)
//console.log("called rajesh");
}
}, options);
store.load(options);
if (App.coach.IsAdmin) {
combo.show()
}
**//Combobox Bind end**
var abilities = App.coach.Abilities,
toolbar = this.getToolbar();
for (var x = 0; x < abilities.length; x++) {
var ability = abilities[x],
button = toolbar.query("button[tooltip=" + ability.Name + "]");
if (button.length) {
button[0].setVisible(true)
}
}
}
},
"PurchaseReportTab > gridpanel": {
bind: this.bind,
itemdblclick: this.handleRecord,
selectionchange: this.selectionChange
}
})
}
});
이 내 모델 부품 이름으로 PurchaseReport.js
Ext.define("App.model.PurchaseReport", {
extend: "Ext.data.Model",
fields: [
{
name: "PurchaseDate",
type: "date"
}
],
proxy: {
type: "ajax",
url: "ControllerFactory.aspx",
extraParams: {
controller: "PurchaseReport",
operation: "GetPurchaseReportsByCoachIdAndDates"
},
reader: {
type: "json",
root: "data",
successProperty: "success"
}
}
});
그리드보기에서 레코드를 표시 할 수 있지만 표시 할 수있는 바닥 글 영역이 필요합니다. 총 구매 금액입니다. 그리드의 바닥 글에
코드를 실수로 찾지 마라. 내가 더 익숙해 져서 더 자세한 정보가 필요하다는 것을 알려주기 위해 많은 것들을 삭제했다.
내가 같은 코드를 추가하는 시도했지만 GRIDVIEW 레코드를 표시되는 경우는 모든 페이지에서 바닥 글을 표시하고, 자세한 내용에 대한 그냥 이미지 또한 다른 페이지 및 구매 비용의 총 코드에서 bbar
를 사용할 필요가 바닥 글을 삽입하기위한
Ext.define("Ext.grid.Panel", {
extend: "Ext.panel.Table",
requires: ["Ext.grid.View"],
alias: ["widget.gridpanel", "widget.grid"],
alternateClassName: ["Ext.list.ListView", "Ext.ListView", "Ext.grid.GridPanel"],
viewType: "gridview",
lockable: false,
bothCfgCopy: ["invalidateScrollerOnRefresh", "hideHeaders", "enableColumnHide", "enableColumnMove", "enableColumnResize", "sortableColumns"],
normalCfgCopy: ["verticalScroller", "verticalScrollDock", "verticalScrollerType", "scroll"],
lockedCfgCopy: [],
rowLines: true,
//Newly addded start
height: 200,
width: 400,
bbar: [
{
xtype: 'textfield',
name: 'Total',
fieldLabel: 'Total',
allowBlank: false
}
],
renderTo: Ext.getBody()
//Newly addded end
});
필자는 특정 페이지에만이 바닥 글을 적용해야하므로,보기 파트에이 코드를 추가해야합니까? (sencha의 나의 버전은 –
입니다.) 그러면 이것을 시도 할 수 있습니다 :'b.bbar' 그리고 코드를 추가하십시오 그. 예, ext 버전 4에서는 괜찮습니다. – UDID
어디서이 b.bar를 작성해야합니까? Ext.grid.Panel에 bbar 코드를 추가하고 격자가있는 페이지의 전체 텍스트 상자를 표시하려고했습니다. 업데이트 질문을 검토하여 bbar를 추가했는지 확인하십시오. –