i have a column(Desc) in my gird as editable
{ name:’tDesc’, index: ‘Desc’, width: 256, stype: ‘text’, sortable: false, editable: true, edittype: ‘select’,editoptions: {readonly: true},formatter: rowColorFormatter,editoptions: { value:”pre:pre; post:post” }},
and another column is date column which is not editable
{ name:’Date’, index: ‘Date’, width: 256, editable: true, stype: ‘text’, sortable: true, sorttype: ‘date’, editoptions: { disabled: “disabled”} }
now based on date column i need to control some of the records to read only.
The logic is that to find the start date for this week and the start date for next week and allow rows where the date is >= the start date for this week and < the start date for next week.
so i used in my aspx as like this
 var curr = new Date;
var firstday = new Date(curr.setDate(curr.getDate() – curr.getDay()));
 unction GetNextWeekStart() {
 var today = moment();
 var daystosunday = 0 – (1 – today.isoWeekday()) + 7;
 var nextSunday = today.subtract(‘days’, daystoSunday);
 return nextSunday;}
Â
How can i use the above method in before edit cell to fulfill my requirement?
Â
beforeEditCell: function (rowid,name,val,iRow,iCol){
  if (rowid == 1){
  jQuery(“#jqg_”+id,”#results”).attr(‘editable’,false);}},
Â
If your looking for cell level changes I suggest:
$(“#results”).removeClass(‘edit-cell’).setCell(rowid,’columnname’,”,’not-editable-cell’);
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top