0
일부 데이터를 저장하고 SQL 2005 데이터베이스에서 생성 된 ID를 반환해야합니다. ID를 저장하기 전에 다른 객체에 전달해야 ID가 올바르게 연관 될 수 있습니다.ExtJS - 방금 저장 한 레코드의 ID 가져 오기
Ext를 사용하여 이것을 수행하는 가장 좋은 방법은 무엇입니까? 이 간단한 프레임 워크에 내장 된 것이 있습니까?
감사합니다.
function AddPromotionType() {
var currentDate = new Date();
var newTypeJsonObject = {
promotionTypeId: '0',
promotionType: Ext.getCmp('txtPromoType').getValue(),
updatedBy: userid,
updateDate: currentDate
}
// serialize our service object
var newLevelJsonData = Ext.encode(newTypeJsonObject);
// call the web service and pass over our service object
Ext.lib.Ajax.defaultPostHeader = 'application/json';
Ext.Ajax.request({
url: 'Service/AddPromoType',
method: 'POST',
params: newLevelJsonData,
success: function(response, options) {
AddTypeWindow.destroy();
AddTypeWindow.hide();
// refresh dropdown to reflect new data
Ext.getCmp('newPromoType').getStore().reload();
},
// if data fails to save, show message
failure: function(response, options) {
Ext.MessageBox.alert('Error saving new promotion type', response.responseText);
}
});
}
이것은 클라이언트 측이 아닌 서버 측과 동의합니다. – Darren
좋습니다. 해명 해줘서 고마워. proc을 조정하여 레코드 값과 C#을 다시 전달해야합니다. – PixelMuse