Select a row in the repeater table to change the color of the repeater table.
// Click a row in the table, and the color of the selected row will change to light blue (the color can be set by yourself)
// Where sellerTable is the table id,
$ ("# SellerTable tbody tr"). mousedown (function (){
$ ("# SellerTable tr"). each (function (){
Certificate (this).css ("background-color ","");
});
Certificate (this).css ("background-color", "#98D8F5 ");
});
// Bind a button event to the foreground (traverse the color in the table. The color of each row is compared with the color of the header. The selected line is the one with different colors)
$ ("# BtnDelete"). click (function (){
Var sellerCD = "";
$ ('# SellerTable tr'). each (function (){
If (((this).css ("background-color ")! = $ ("Th" ).css ("background-color ")){
SellerCD = $ (this). find ("td"). eq (0). text (); // set sellerCD as the value of the first column
Return false;
}
});
If (sellerCD = null | sellerCD = undefined | sellerCD = ""){
Alert. ");
} Else {
// Send data upon page Jump. You can obtain the data on the SellersDetail page, for example, sellerCD = Request. QueryString ["sellerCD"];
Window. location. href = "SellersDetail. aspx? Type = delete & sellerCD = "+ sellerCD;
}
})