Jul 11, 2011

Select Grid View Row In JQuery

// empid (click on grid view row)

function EditData(empId)
{

// getting emp details
$(empId).parent().parent().find('td').each(function(index){
//alert($(this).text());
if (index==0) { $("#"+ '<%=HiddenField1.ClientID %>').val($(this).text()); }
if (index==1) { $("#"+ '<%=TextUserNm.ClientID %>').val($(this).text()); }
if (index==3) { $("#"+ '<%=TextAdd.ClientID %>').val($(this).text()); }
if (index==2) { $("#"+'<%=DDLDept.ClientID %>'+' option:contains('+$(this).text().trim()+ ')').attr('selected', 'selected'); }
if (index==4) { $("#"+ '<%=TextJDate.ClientID %>').val($(this).text()); }
if (index==4) { $("#"+ '<%=TextLDate.ClientID %>').val($(this).text()); }
});

//enable edit button
$("#"+ '<%=ButtonEdit.ClientID %>').attr("disabled","");
$("#"+ '<%=ButtonAddUser.ClientID %>').attr("disabled","true");
}

No comments:

Post a Comment

What is the use of n-tier architecture and 3-tier architecture?

how to implement 3-tier architecture in asp.net using c#. 3-Tier architecture is also called layered architecture. Some people called it ...