我有一個下拉(與Paid and unpaid
作爲選項)和一個按鈕的局部視圖。 當用戶在頁面的子菜單中單擊Paid/Unpaid List link
時,我使用jquery load加載此部分視圖。問題與jQuery對話框
當我在下拉菜單中選擇付費並點擊按鈕時,它會在jquery對話框中顯示付費客戶列表,如果我選擇Unpaid並單擊按鈕,它會在jquery對話框中顯示未付費客戶。
我寫了下面的代碼對話框:
$('#customers').dialog({
bgiframe: true,
autoOpen: false,
open: function(event, ui) {
//populate table
var p_option = $('#d_PaidUnPaid option:selected').val();
if (p_option == 'PAID') {
$("#customercontent").html('');
//$("#customercontent").load("/Customer/Paid");
}
else if (p_option == 'UNPAID') {
$("#customercontent").html('');
//$("#customercontent").load("/Customer/Unpaid");
}
},
close: function(event, ui) {
//do nothing
},
height: 500,
width: 550,
modal: true
});
這是第一次,我在jQuery的對話框中正確添加到列表,但是當我再次點擊Paid/Unpaid List link
和選擇下拉未付並點擊按鈕,它會在jquery對話框中顯示previos加載的內容。
我在這裏做錯了什麼?
我應該在哪裏添加這一行?加載部分視圖之前? - – Prasad 2009-11-03 04:39:14
甚至在$('#customers')。對話框({...應該足夠了。如果你有任何類型的javascript bootstrap文件,那就是它通常會去的地方 – 2009-11-03 04:42:57
我之前在button的click事件中調用過打開對話框,但問題仍然存在 – Prasad 2009-11-03 04:48:28