dear masbin , udah bisa di test ya
- jika ingin di hilangkan kaca pembesar itu di read only
package autoload :
sdataTablefield (PHRPA0002 (position)selectfuntion)
var Mainform = Ext.ComponentQuery.query('[name=' + val.formname + ']')[0];
var StartDate = Mainform.getForm().findField('StartDate').getValue();
var objClassValue = val.objClassValue;
var hasil = undefined;
var cc = null;
Ext.Ajax.request({
async: false,
method: 'POST',
url: '/UserControl/GetStore',
params: {
tableName: 'PHROM0006',
param: 'StartDate[<=]' + _StartDate + ',EndDate[>=]' + _StartDate + ',ObjectID[=]' + val.getValue() + ',ObjectClass[=]' + objClassValue
},
success: function (response) {
var results = Ext.decode(response.responseText);
if (results.data.length > 0) {
hasil = results.data0;
Mainform.getForm().findField('Job').setValue(hasil.Job);
Mainform.getForm().findField('CostCenter').setValue(hasil.CostCenter);
} else {
Mainform.getForm().findField('Job').setValue('');
Mainform.getForm().findField('CostCenter').setValue('');
}
}
});
var Org = null;
Ext.Ajax.request({
async: false,
method: 'POST',
url: '/UserControl/GetStore',
params: {
tableName: 'PHROM0002',
param: 'StartDate[<=]' + StartDate + ',EndDate[>=]' + _StartDate + ',ObjectID[=]' + val.getValue() + ',ObjectClass[=]P,RelationshipDirectory[=]B,RelationshipClass[=]O'
},
success: function (response) {
results = (response.responseText);
Org = Ext.decode(results);
if (Org_.data.length > 0) {
Org = Org_.data0;
Mainform.getForm().findField('Organization').setValue(Org.RelationshipObject);
console.log(Org.RelationshipObject)
} else {
Mainform.getForm().findField('Organization').setValue('');
}
}
});
if (Mainform.getForm().findField('CostCenter').getValue() == '') {
Ext.Ajax.request({
async: false,
method: 'POST',
url: '/ORM/GetCostCenter?ObjectID=' + val.getValue() + '&class=' + objClassValue + '&keyDate=' + StartDate + '&isOneLevel=false',
success: function (response) {
results = (response.responseText);
cc = Ext.decode(results);
cc = cc_.results.data;
Mainform.getForm().findField('CostCenter').setValue(cc);
}
});
}
if (val.getValue() == '') {
Mainform.getForm().findField('Organization').setValue('');
Mainform.getForm().findField('CostCenter').setValue('');
}
makasih