Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Need only some rows to read only
10/10/2014
20:47
Avatar
mcfarland
Member
Members
Forum Posts: 11
Member Since:
07/10/2014
sp_UserOfflineSmall Offline

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});
        }
      }
    }
  }
}

21/10/2014
15:45
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
58 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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information