Forum
20:47
07/10/2014
Hi,
  I am wondering like the below code which i am implementing is right or not?
I have four columns in that  one column is date column,based on number of days from data loaded we need to control it.
Eg:( every tuesday we have data loaded in our databases like next 2 weeks data;right now i want to edit only curent week records like from sun - sat (from oct 5 to 11) and next week data should be in read mode..because next week data will be uploaded again for next tme..in order to avoid data overwritten..
Â
based on date how can i control?
Â
function GridComplete() {
 var grid = $('#results');
 var rowids = grid.getDataIDs();
 var columnModels = grid.getGridParam().colModel;
Â
 // check each visible row
 for (var i = 0; i < rowids.length; i++) {
   var rowid = rowids[i];
   var data = grid.getRowData(rowid);
   if (data.date== '0') {      // view only
     // check each column
     for (var j = 0; j < columnModels.length; j++) {
       var model = columnModels[j];
       if (model.editable) {
         grid.setCell(rowid, model.name, '', 'not-editable-cell', {editable: false});
       }
     }
   }
 }
}
15:45
Moderators
30/10/2007
Hello,
Since you speak for rows, but you use cell class,
you can use the rowattr grid parameter event to set not editable row class (not-editable-row)
Â
Regards
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 715
Currently Online:
56 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66