PDA

View Full Version : confirmation message problem



rubynile
30 Sep 2009, 8:51 PM
I am trying to use confirmation message in my code.If am taking 3 rows and trying to add those rows to grid for each row it have to ask confirmation message.Am using this code only but its not working it telling selectedData[i] is undefined and showing this line
selectedData[i].data["id_billboard"].If any one found what is the error in my code please help me:((


function addQuoteData() {
selectedData = QuoteData.getSelectionModel().getSelections();
var billboard_status="",quote_billboard_name="";
if(selectedData.length<=0){
Ext.Msg.alert('Information', "Please select at least one Media");
return ;
}else{
for(i=0;i<selectedData.length;i++) {
billboard_status=selectedData[i].data["billboard_status"];
quote_billboard_name=selectedData[i].data["quote_billboard_name"];
if(billboard_status=="NOT BOOKED"){
var quoteStoreRec = new quoteRecord({
id_billboard:selectedData[i].data["id_billboard"],
code_billboard:selectedData[i].data["quote_billboard_name"],
location:selectedData[i].data["quote_location"],
rentalprice:selectedData[i].data["Billboard_rate"],
proInstCharg:'0.00',
total:'0.00',//Math.round(totals)
extacost:'0.00',
salesorder_deatil_ref_id:'0' ,
illumCharge:'0.00',
installcharge:'0.00',
agecomm:'0.00',
reseravation_start_date:selectedData[i].data["searchstartdate"],
reseravation_end_date:selectedData[i].data["searchenddate"],
invoice_start_date:selectedData[i].data["searchstartdate"],
area:selectedData[i].data["area"]
});
quoteStore.add(quoteStoreRec);
Ext.getCmp('BillboardSearchWin1').close();
}
else if(billboard_status=="Quote Blocked")
{
Ext.Msg.show({
title:'Warning',
msg: 'Are you sure you want to Book,This site '+quote_billboard_name+'is Blocked By ',
buttons:{
yes:true,
no:true
},
fn:function(btn){
if(btn=="yes"){
var quoteStoreRec = new quoteRecord({
id_billboard:selectedData[i].data["id_billboard"],
code_billboard:selectedData[i].data["quote_billboard_name"],
location:selectedData[i].data["quote_location"],
rentalprice:selectedData[i].data["Billboard_rate"],
proInstCharg:'0.00',
total:'0.00',//Math.round(totals)
extacost:'0.00',
salesorder_deatil_ref_id:'0' ,
illumCharge:'0.00',
installcharge:'0.00',
agecomm:'0.00',
reseravation_start_date:selectedData[i].data["searchstartdate"],
reseravation_end_date:selectedData[i].data["searchenddate"],
invoice_start_date:selectedData[i].data["searchstartdate"],
area:selectedData[i].data["area"]
});
quoteStore.add(quoteStoreRec);
Ext.getCmp('BillboardSearchWin1').close();
}else if(btn=='no'){
return;
}
} });
}
}

}
}