jquery-ajax problem
jquery-ajax problem
hi i m implement webmail lyk newer yahoo mail. i have panel in which i fetch mailboxes from database.if i click on (inbox) mailbox i got inbox mail in table view.if i click multiple times on mailboxes and then after i drop mail ajax call mailtiple times...
1)here code is get mail boxes(asp.net)
<%
Dim cn1 As NpgsqlConnection
cn1 = New NpgsqlConnection(ConfigurationManager.AppSettings("CN"))
cn1.Open()
Dim Str1 As String = ("select mailbox_name,mailbox_id from mailboxes where user_id=" & 0)
Dim da1 As NpgsqlDataAdapter = New NpgsqlDataAdapter(Str1, cn1)
Dim row1 As DataRow
Dim ds1 As DataSet = New DataSet()
da1.Fill(ds1, "mailboxes")
Dim dt1 As DataTable = ds1.Tables("mailboxes")
For Each row1 In dt1.Rows
%>
<div id="<%Response.Write(row1("mailbox_id").ToString)%>" style="cursor:pointer;"><span ><img src="images/mini-folder.gif" alt="folder"/></span> <% Response.Write(row1("mailbox_name").ToString)%></div>
<%
Next
%>
2)using this jquery and ajax i got mail in table view
$('#droppable div').bind("click", function(e){
var mailbox_id=$(this).attr("id");
ajaxdisplay("mail.aspx?id="+ mailbox_id,"display");
});
3)this jquery i used for to drag mail and drop on mailboxs
$(".messagerow").draggable({
// use a helper-clone that is append to 'body' so is not 'contained' by a pane
helper: function () {return $('<div>message</div>').clone().appendTo('body').css('zIndex',5).show(); },
cursor: 'pointer',
cursorAt: { top: 5, left: -12}
});
$("#droppable div").droppable({
accept: '.messagerow',
drop: function(event, ui){
var droppableID =($(this).attr("id"));
alert("droppableID" + droppableID);
movemail(ui.draggable,droppableID);
var draggableID = new Array();
$("input[name='chk']:checked").each(function(){
draggableID.push($(this).val())
});
data="mailID=" + draggableID + "&dropID=" + droppableID;
ajaxmove(data)
}
});