<script>
function DataBound(e)
{
var dataItems = e.sender.dataSource.view(); // getting dataitems from kendo grid
var d = new Date(),
n = d.getMonth() + 1,
y = d.getFullYear(),
z = d.getDate();
for (var j = 0; j < dataItems.length; j++)
{
var row = e.sender.tbody.find("[data-uid='" + dataItems[j].uid + "']");
if (dataItems[j].MonthNumber < n)
{
row.find('.k-grid-edit').enable(false);
row.find('.k-grid-edit').css("cursor", "not-allowed");
}
if (z < 6) // upto 20th of current month and 5th of next month we need to allow for edit
{
var month = n - 1
if (dataItems[j].MonthNumber == month)
{
row.find('.k-grid-edit').enable(true);
}
}
}
}
</script>
No comments:
Post a Comment