目的: V80203- 工單需求物料查詢 – 顯示 Grid子畫面
處理說明: 1>呼叫子畫面函式: Call_V80203B();
2>子畫面處理:
var win = getMyWindow("顯示原始需求物料", sub_BackFlds, sub_BackFlds_Btns);
Ext.getCmp('sub_Grid').store.getProxy().url = '../../api/V80203BAPI/get_sub_data1',
Ext.getCmp('sub_Grid').store.getProxy().extraParams = np; //分頁OK,篩選條件OK
Ext.getCmp('sub_Grid').store.load();
win.show();

Ext.getCmp('sub_Grid').store.getProxy().extraParams = np; //分頁OK,篩選條件OK
Ext.getCmp('sub_Grid').store.load();
win.show();
1>V80203.js
{
xtype: 'button', text: '顯示原始需求物料', id: 'Call_V80203B_Btn',
listeners: {
click: function () {
//mysuccessalert(" call BatAddBtn_click() ");
Call_V80203B();
}
}
},
{
xtype: 'button', text: '顯示原始需求物料', id: 'Call_V80203B_Btn',
listeners: {
click: function () {
//mysuccessalert(" call BatAddBtn_click() ");
Call_V80203B();
}
}
},
2>V80203B.js
function Call_V80203B() {
//按鈕 : [離開]
var sub_BackFlds_Btns = [
{
xtype: 'button', text: '離開', id: 'sub_BackFlds_CancelBtn',
listeners: {
click: function () {
//mysuccessalert("mysub2_取消");
var Tmp_win = this.up("window");
if (Tmp_win == undefined) {
Ext.Msg.alert("取消時未取到Window Object");
}
this.up("window").close();
this.up("window").destroy();
}
}
},
];
//sub_ Grid
var sub_Grid = Ext.create('TMGrid', {
grid_id: 'sub_Grid',
columns: sub_B_Columns,
autoScroll: true,
flex: 1,
store: Ext.create('gridstore', { model: sub_B_Fields }),
});
console.log("step2.5");
function Call_V80203B() {
//按鈕 : [離開]
var sub_BackFlds_Btns = [
{
xtype: 'button', text: '離開', id: 'sub_BackFlds_CancelBtn',
listeners: {
click: function () {
//mysuccessalert("mysub2_取消");
var Tmp_win = this.up("window");
if (Tmp_win == undefined) {
Ext.Msg.alert("取消時未取到Window Object");
}
this.up("window").close();
this.up("window").destroy();
}
}
},
];
//sub_ Grid
var sub_Grid = Ext.create('TMGrid', {
grid_id: 'sub_Grid',
columns: sub_B_Columns,
autoScroll: true,
flex: 1,
store: Ext.create('gridstore', { model: sub_B_Fields }),
});
console.log("step2.5");
// [顯示原始需求物料]鈕 - 子畫面欄位
var sub_BackFlds = [
{
type: 'panel', bodyStyle: "background-color:transparent;", border: 0, padding: "5",
flex: 100,
//layout: { type: 'vbox', align: 'stretch' },
layout: 'border',
items: [
{
xtype: 'panel',
id: 'sub_panel1',
region: 'north',
layout: { type: 'hbox', align: 'stretch' },
//flex: 0,
//border: 1,
items: []
}, //end of panel1
{
xtype: 'panel',
id: 'sub_panel2',
//title: 'sub_panel2',
region: 'center',
layout: 'fit',
//flex: 60,
//border: 20,
items: [sub_Grid]
},
] // end of layout: "vbox", padding: "5", items: [
} //end of my_Sub2 , items[{
] //end of my_Sub2 , items[
Ext.getCmp('sub_Grid').store.on("load", function (me, records, successful, eOpts) {
if (successful) {
console.log("Ext.getCmp('sub_Grid').store", Ext.getCmp('sub_Grid').store);
console.log("Ext.getCmp('sub_Grid').store.data", Ext.getCmp('sub_Grid').store.data);
}
}
);
var win = getMyWindow("顯示原始需求物料", sub_BackFlds, sub_BackFlds_Btns);
//var win = getMyWindow("歸還登記", sub_BackFlds);
win.width = 800;
win.heigh = 400;
var cur_recs = Ext.getCmp('grid_M').getSelectionModel().getSelection();
if (cur_recs.length == 0) {
var Tmp_Str = "請先選擇資料";
mywarnalert(Tmp_Str);
return ;
}
var cur_rec = cur_recs[0];
var Tmp_AMMNO = cur_rec.data['AMMNO'].toString();
var np = {};
np["AMMNO"] = Tmp_AMMNO;
var is_Ok = true;
var sub_BackFlds = [
{
type: 'panel', bodyStyle: "background-color:transparent;", border: 0, padding: "5",
flex: 100,
//layout: { type: 'vbox', align: 'stretch' },
layout: 'border',
items: [
{
xtype: 'panel',
id: 'sub_panel1',
region: 'north',
layout: { type: 'hbox', align: 'stretch' },
//flex: 0,
//border: 1,
items: []
}, //end of panel1
{
xtype: 'panel',
id: 'sub_panel2',
//title: 'sub_panel2',
region: 'center',
layout: 'fit',
//flex: 60,
//border: 20,
items: [sub_Grid]
},
] // end of layout: "vbox", padding: "5", items: [
} //end of my_Sub2 , items[{
] //end of my_Sub2 , items[
Ext.getCmp('sub_Grid').store.on("load", function (me, records, successful, eOpts) {
if (successful) {
console.log("Ext.getCmp('sub_Grid').store", Ext.getCmp('sub_Grid').store);
console.log("Ext.getCmp('sub_Grid').store.data", Ext.getCmp('sub_Grid').store.data);
}
}
);
var win = getMyWindow("顯示原始需求物料", sub_BackFlds, sub_BackFlds_Btns);
//var win = getMyWindow("歸還登記", sub_BackFlds);
win.width = 800;
win.heigh = 400;
var cur_recs = Ext.getCmp('grid_M').getSelectionModel().getSelection();
if (cur_recs.length == 0) {
var Tmp_Str = "請先選擇資料";
mywarnalert(Tmp_Str);
return ;
}
var cur_rec = cur_recs[0];
var Tmp_AMMNO = cur_rec.data['AMMNO'].toString();
var np = {};
np["AMMNO"] = Tmp_AMMNO;
var is_Ok = true;
//顯示 store 的資料
Ext.getCmp('sub_Grid').store.getProxy().url = '../../api/V80203BAPI/get_sub_data1',
Ext.getCmp('sub_Grid').store.getProxy().extraParams = np; //分頁OK,篩選條件OK
Ext.getCmp('sub_Grid').store.load();
win.show();
console.log("step6");
} // end of function LendBtn_click() {
Ext.getCmp('sub_Grid').store.getProxy().url = '../../api/V80203BAPI/get_sub_data1',
Ext.getCmp('sub_Grid').store.getProxy().extraParams = np; //分頁OK,篩選條件OK
Ext.getCmp('sub_Grid').store.load();
win.show();
console.log("step6");
} // end of function LendBtn_click() {
沒有留言:
張貼留言