我有一个下拉(与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