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
Hidden column values not posting
20/08/2011
00:59
Avatar
cjordan
USA
Member
Members
Forum Posts: 11
Member Since:
20/08/2011
sp_UserOfflineSmall Offline

I've searched around the net for a while on this subject, and found a thread or two here and there that were close to the same as the problem I'm having, but not quite.

My scenario is that my jqGrid does not look like the table that stores the data. The table is normalized, but my grid is showing an aggregate of the data. So each row in my jqGrid represents up to 13 rows of data in the normalized table.

So, when I'm editing a "row" in the grid on the client side, I'm really potentially editing 13 rows of data in the table itself. My problem is that I need IDs for each of those table rows. So, after toying around with some other ideas, I finally decided on pulling down the IDs as part of my grid row data, and then I would just hide the ID columns from the user. This would appear to be a fine solution except that the hidden rows are not posting when I edit a grid row in-line.

For example, my jqGrid might contain:

column1 column2ID(hidden) column2 column3ID(hidden) column3
someVal   1234            value1    5678            value2

and the table in the DB for this data would be:

ID     Label    Value
1234  someVal   value1
5678  someVal   value2

I know this seems contrived (because it is), but there's more data on each row that actually makes this make sense, I'm just hoping this gets my point across.

So, I cannot have these hidden values show to the user, and they cannot be editable because they're IDs and I need to maintain their integrity, but I need them to post after editing a grid row in-line… currently, they are not.

Here's my colModel definition, in case that helps anyone:

colModel: [
 {name:'JOBCODE',index:'JOBCODE',width:85,classes:'ap',sortable:false,editable:true},
 {name:'JOBDESC',index:'JOBDESC',width:175,classes:'ap',sortable:false,editable:true},
 {name:'PRFEEID',index:'PRFEEID',hidden:true},
 {name:'PRFEE',index:'PRFEE',width:70,align:'center',classes:'ap',sortable:false,editable:true},
 {name:'GROSSID',index:'GROSSID',hidden:true},
 {name:'GROSS',index:'GROSS',width:57,align:'center',classes:'ap',sortable:false,editable:true},
 {name:'BONUSID',index:'BONUSID',hidden:true},
 {name:'BONUS',index:'BONUS',width:57,align:'center',classes:'ap',sortable:false,editable:true},
 {name:'FICAID',index:'FICAID',hidden:true},
 {name:'FICA',index:'FICA',width:57,align:'center',classes:'ap',sortable:false,editable:true},
 {name:'FUTAID',index:'FUTAID',hidden:true},
 {name:'FUTA',index:'FUTA',width:57,align:'center',classes:'ap',sortable:false,editable:true},
 {name:'SUTAID',index:'SUTAID',hidden:true},
 {name:'SUTA',index:'SUTA',width:57,align:'center',classes:'ap',sortable:false,editable:true},
 {name:'OTHERID',index:'OTHERID',hidden:true},
 {name:'OTHER',index:'OTHER',width:57,align:'center',classes:'ap',sortable:false,editable:true},
 {name:'WCID',index:'WCID',hidden:true},
 {name:'WC',index:'WC',width:57,align:'center',classes:'ap',sortable:false,editable:true},
 {name:'MEDID',index:'MEDID',hidden:true},
 {name:'MED',index:'MED',width:57,align:'center',classes:'ap',sortable:false,editable:true},
 {name:'RENTID',index:'RENTID',hidden:true},
 {name:'RENT',index:'RENT',width:57,align:'center',classes:'ap',sortable:false,editable:true},
 {name:'TAXID',index:'TAXID',hidden:true},
 {name:'TAX',index:'TAX',width:57,align:'center',classes:'ap',sortable:false,editable:true},
 {name:'BENEFITSID',index:'BENEFITSID',hidden:true},
 {name:'BENEFITS',index:'BENEFITS',width:57,align:'center',classes:'ap',sortable:false,editable:true},
 {name:'_401KID',index:'_401KID',hidden:true},
 {name:'_401K',index:'_401K',width:57,align:'center',classes:'ap',sortable:false,editable:true}
],
22/08/2011
17:38
Avatar
cjordan
USA
Member
Members
Forum Posts: 11
Member Since:
20/08/2011
sp_UserOfflineSmall Offline

So, it turns out that the hidden column values will not post unless you have "editable" set to true in the colModel

colModel: [
 {name:'JOBCODE',index:'JOBCODE',width:85,classes:'ap',sortable:false,editable:true},
 {name:'JOBDESC',index:'JOBDESC',width:175,classes:'ap',sortable:false,editable:true},
 {name:'PRFEEID',index:'PRFEEID',hidden:true,editable:true},
 {name:'PRFEE',index:'PRFEE',width:70,align:'center',classes:'ap',sortable:false,editable:true},
 {name:'GROSSID',index:'GROSSID',hidden:true,editable:true},
 {name:'GROSS',index:'GROSS',width:57,align:'center',classes:'ap',sortable:false,editable:true},
 {name:'BONUSID',index:'BONUSID',hidden:true,editable:true},
 ...(snip)

My initial fear with this attribute was that it would cause the hidden column values to show when I went to edit the row in-line. This however, isn't the case.

I really wish this was better documented. Really, that's my only complaint about the plug-in in general.

08/03/2012
23:52
Avatar
kudoof
Member
Members
Forum Posts: 3
Member Since:
05/03/2012
sp_UserOfflineSmall Offline

Edit: never mind.  The hidden column did not show in the pop up window now. I guess I did not reload

found out the same thing. On top of this, I also want to prevent the hidden column/cell showing up in the pop-up edit window (It is supposed to be 'hidden' everywhere !). Is there an option for that? I searched the 'editrules' section but the only thing there is to re-enable edithidden but not hideeditable. Maybe make hidden customized element?

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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