I am trying to prevent users to enter more than a set number of rows per header in a batch edit mode grid.
how to cancel the event ? Anybody has done that before ?
I will paste my javascript below but preventDefault does not cancel the event.
Thank you for all your support
Claudio
var icounter = 0;
//========================================
function Grid_onLoad(e) {
icounter = document.getElementById('TotalGriRowCount').value;
}
//========================================
function Grid_onEdit(e) {
var I_MAXLINES =5;
if (e.mode == "insert")
{
if ((icounter + 1) > I_MAXLINES) {
alert("Not allowed to enter more than " + I_MAXLINES + " rows per header !");
e.preventDefault();
}
else {
icounter++;
}
};
return;
}
//========================================
function Grid_onDelete(e) {
icounter--;
return;
}
//========================================