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_Related Related Topics sp_TopicIcon
How can I drop a column out of the inline edit
01/09/2010
19:16
Avatar
donsom0702
Member
Members
Forum Posts: 5
Member Since:
08/07/2010
sp_UserOfflineSmall Offline

Newbie question,

I have a situation where they want to be able to add via the standard navgrid form with the key field in the first column and then edit via the inline editing using the select row option.   I do not want to allow the key field in column 1 to be editable in for the inliine editing (changing the key).   Does anyone have any ways to accomplish this?   

TIA for any help. 

01/09/2010
19:40
Avatar
steve.longdo
Member
Members
Forum Posts: 6
Member Since:
13/08/2010
sp_UserOfflineSmall Offline

Just add editable:false to the colmmodel for the field you don't want to be editable.

01/09/2010
21:12
Avatar
donsom0702
Member
Members
Forum Posts: 5
Member Since:
08/07/2010
sp_UserOfflineSmall Offline

If I do that then it does not show up in the Add form when they go to do the add.   Is there a way to enable it dynamically on the add form?

09/09/2010
22:16
Avatar
donsom0702
Member
Members
Forum Posts: 5
Member Since:
08/07/2010
sp_UserOfflineSmall Offline

Actually I figured out a way to do this by leaving the field as editable in the COLMODEL and in the onSelectRow I set a global variable (edit_id)  and then when I call the editrow method I pass the function oneditfunc which according to the doc is "oneditfunc: fires after successfully accessing the row for editing, prior to allowing user access to the input fields. The row's id is passed as a parameter to this function."

In that function I derived the ID's of the column that has the code I do not want them to edit and set the disabled attribute.  I also set the focus to the next editable field.   This way it is still available in the Add form but is disabled for inline updates. Below is some sample code.  

 onSelectRow: function(id){
         if(id && id !== lastSel){
            if (lastSel != "")
            {  
               jQuery('#grid').restoreRow(lastSel);   
            }    
            lastSel=id;
         }
        edit_id = id;  
       jQuery('#grid').editRow(id, true, oneditfunc);
   },

function oneditfunc() {  
  var col_id1 = '#' + edit_id + '_COMM_CODE';
  var col_id2 = '#' + edit_id + '_COMM_NAME';
 //  alert(col_id1);
   $(col_id2).focus();
   $(col_id1).attr("disabled","disabled");
}   

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
60 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