$(document).ready(function() {
$("#gvList").find("select[id*=ddlOutSotre]").each(function() {
var gv_tr = $(this).parent().parent();
var txtCurrentQty = gv_tr.find("input:text[id*='txtCurrentQty']");
var ProductID = gv_tr.find("input:hidden[id*='hidProductID']");
var lblCurrentNum = gv_tr.find("span[id*='lblCurrentNum']");
$(this).change(function(event) {
$.ajax({
url: "/Ajax/StoreManage/GetCurrentQty.ashx",
type: "get",
data: {
"SHID": $(this).val(),
"ProductID": ProductID.val()
},
datatype: "json",
beforeSend: function(x) {
x.setRequestHeader("Content-Type", "application/json; charset=utf-8");
},
success: function(data) {
alert(data);
lblCurrentNum.text(data);
txtCurrentQty.val(data);
if (data <= 0) {
gv_tr.addClass("gv_red");
} else {
gv_tr.removeClass("gv_red");
}
},
error: function(msg) {
alert("error" + msg);
}
});
});
});
});