$('#grdtimereport')。prop('disabled',true);正在使用IE但不是Chrome [英] $('#grdtimereport').prop('disabled', true); is working IE but not in chrome
问题描述
#grdTimeReport网格应该在点击批准按钮时被禁用。
它在IE中工作正常但不在Chrome中。
我尝试过:
函数OnchangeStatus()
{< br $>
调试器;
var YearFromPage = $(#selYear)。val();
var MonthFromPage = $(#selMonth) .val();
var EmployeeID = $(#hdnusrTableId)。val();
var status = $(#selStatus)。val() ;
var id = statusID;
if(status ==2){
$('#grdTimeReport')。prop( 'disabled',true);
timesheetStatus =已批准;
$(#statusLabel)。css(color,Green);
$(#statusLabel)。text(timesheetStatus);
$ .ajax({
contentType:'application / json',
类型:'POST',
dataType:json,
data:JSON.stringify({Id:id,EmpId:EmployeeID,year:YearFromPage,month:MonthFromPage,status:timesheetStatus}),
url:timesheetStatusUpdateUrl ,
成功:函数(数据){
//调试器;
hideModificationOption();
窗口。 alert(状态更新成功);
},
错误:function(error,errostatus,er){debugger; }
});
}
else {
$('#grdTimeReport')。prop('disabled',false);
timesheetStatus =拒绝;
$(#statusLabel)。css(color,Red);
$(#statusLabel) .text(timesheetStatus);
$ .ajax({
contentType:'application / json',
类型:'POST',
dataType:json,
数据:JSON.stringify({Id:id,EmpId:EmployeeID,year:YearFromPage,month: MonthFromPage,status:timesheetStatus}),
url:timesheetStatusUpdateUrl,
成功:函数(数据){
window.alert(状态更新成功);
},
错误:函数(错误,错误,错误){调试器;}
}); < br $>
}
}
#grdTimeReport grid should get disabled when clicking on approve button.
It was working fine in IE but not in chrome.
What I have tried:
function OnchangeStatus()
{
debugger;
var YearFromPage = $("#selYear").val();
var MonthFromPage = $("#selMonth").val();
var EmployeeID = $("#hdnusrTableId").val();
var status = $("#selStatus").val();
var id = statusID;
if (status == "2") {
$('#grdTimeReport').prop('disabled', true);
timesheetStatus = "Approved";
$("#statusLabel").css("color", "Green");
$("#statusLabel").text(timesheetStatus);
$.ajax({
contentType: 'application/json',
type: 'POST',
dataType: "json",
data: JSON.stringify({ "Id": id, "EmpId": EmployeeID, "year": YearFromPage, "month": MonthFromPage, "status": timesheetStatus }),
url: timesheetStatusUpdateUrl,
success: function (data) {
//debugger;
hideModificationOption();
window.alert("Status updated successfully");
},
error: function (error, errostatus, er) { debugger; }
});
}
else {
$('#grdTimeReport').prop('disabled', false);
timesheetStatus = "Denied";
$("#statusLabel").css("color", "Red");
$("#statusLabel").text(timesheetStatus);
$.ajax({
contentType: 'application/json',
type: 'POST',
dataType: "json",
data: JSON.stringify({ "Id": id, "EmpId": EmployeeID, "year": YearFromPage, "month": MonthFromPage, "status": timesheetStatus }),
url: timesheetStatusUpdateUrl,
success: function (data) {
window.alert("Status updated successfully");
},
error: function (error, errostatus, er) { debugger;}
});
}
}
推荐答案
(# selYear)。val();
var MonthFromPage =
("#selYear").val();
var MonthFromPage =
(#selMonth)。val();
var EmployeeID =
("#selMonth").val();
var EmployeeID =
(#hdnusrTableId)。val();
var status =
("#hdnusrTableId").val();
var status =
这篇关于$('#grdtimereport')。prop('disabled',true);正在使用IE但不是Chrome的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!