I have a kendo gird with a custom button that if disable should not allow the user to fire the click event. This works as expected in IE but in chrome the event still fires even though the button is disabled.
I disable the button like this
function onDatabound(e) {
var grid = this;
grid.tbody.find("tr").each(function () {
var model = grid.dataItem(this);
if (model.DraftIndicator) {
var customButton = $(this).find(".k-grid-Download");
customButton.attr('disabled', '');
}
});
I even specifically ignore the logic on the onClick event method if the button is disabled.
function download(e) {
e.preventDefault();
var downloadButton = e.target;
if (!downloadButton.disabled) {
var tr = $(downloadButton).closest("tr");
var data = this.dataItem(tr);
var url = '@Url.Action("DetailsPopup", "Home")?Id=' + data.id;
window.open(url, null, "height=600,width=1200px,status=yes,toolbar=no,menubar=no,location=no,scroll=yes");
}
}
is there something special i have to do for Chrome to prevent the click event
I disable the button like this
function onDatabound(e) {
var grid = this;
grid.tbody.find("tr").each(function () {
var model = grid.dataItem(this);
if (model.DraftIndicator) {
var customButton = $(this).find(".k-grid-Download");
customButton.attr('disabled', '');
}
});
I even specifically ignore the logic on the onClick event method if the button is disabled.
function download(e) {
e.preventDefault();
var downloadButton = e.target;
if (!downloadButton.disabled) {
var tr = $(downloadButton).closest("tr");
var data = this.dataItem(tr);
var url = '@Url.Action("DetailsPopup", "Home")?Id=' + data.id;
window.open(url, null, "height=600,width=1200px,status=yes,toolbar=no,menubar=no,location=no,scroll=yes");
}
}
is there something special i have to do for Chrome to prevent the click event