Forum


Hi,
I have a grid that has inline editing for an 8 column grid (4 columns are hidden, but editable). I also have a function which opens the add row modal form. When I first click the button the modal opens with all correct fields visible and it is possible to add a new record.
If I then try to add another row (after the original modal has closed), the modal opens but only shows a subset of the form fields - it shows the columns that are visible in the grid. If I refresh the page and click the button again the modal opens with the correct fields.
My button code is:
$("#assignPos").click(function() {
$("#list").editGridRow("_empty",{top:100,left:340,width:600,height:340,reloadAfterSubmit:true,
onInitializeForm: function(id){
$("#StartDate",id).datepicker({showOn: 'focus',dateFormat:"yy-mm-dd"});
$("#FinishDate",id).datepicker({showOn: 'focus',dateFormat:"yy-mm-dd"});
},url:"assets/includes/assignPosition.cfm?PersonID="+$("#PersonID").val()});
});
The colModel is:
colModel:[
{name:'tjppid',key: true,index:'tjppid',hidden:true,editable:true,editoptions:{readonly:true,size: 15}},
{name:'PositionID',index:'PositionID',width:150,editable:true,editoptions:{readonly:true,size:15}},
{name:'PositionType',index:'PositionType',width: 270},
{name:'ParishName',index:'ParishName',width: 270},
{name:'StartDate',index:'StartDate',sorttype:"date",editable:true,editoptions:{size:10,maxlength:10},width:100},
{name:'FinishDate',index:'FinishDate',sorttype:"date",editable:true,editoptions:{size:10,maxlength:10},width:100},
{name:'Position',index:'Position',hidden:true,editable:true,edittype:'select',editoptions:{value:"0:Select Position;<cfloop query="qPositions"><cfoutput>#PositionID#:#PositionType# - #ParishName#<cfif recordcount gt currentrow>;</cfif></cfoutput></cfloop>"}},
{name:'CommitteeMemberTypeID',index:'CommitteeMemberTypeID',hidden:true,editable:true,edittype:'select',editoptions:{value:"0:Select Member Type;<cfloop query="qCMType"><cfoutput>#MemberTypeID#:#MemberType#<cfif recordcount gt currentrow>;</cfif></cfoutput></cfloop>"}},
{name:'ClergyStatusID',index:'ClergyStatusID',hidden:true,editable:true,edittype:'select',editoptions:{value:"0:Select Clergy Status;<cfloop query="qClergyStatus"><cfoutput>#StatusID#:#Status#<cfif recordcount gt currentrow>;</cfif></cfoutput></cfloop>"}}]
I modified the jqgrid.js file so that hidden fields that were editable would be seen in the modal form but maybe this has broken the code? In grid.formedit.js I modified the createData function as follows:
//dc = hc ? "style='display:none'" : ""; changed to:
dc = hc ? "" : "";
This allows hidden grid columns to be editable in the modal form.
Have I broken jqgrid, or is this a bug?
I am using version 3.2rc
Cheers,
Dave
11:05

Moderators
30/10/2007

The feature to edit hidden fields in formedit is added in final release.
Release
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:
74 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