Forum


Hi,
I am trying to add a new row to a grid when a button is clicked. When
the button is click the following function is called:
$("#assignPos").click(function() {
$("#list").editGridRow("new",{height:280,reloadAfterSubmit:false});
});
When the button is clicked the overlay appears but the actual modal window remains hidden. I have inspected the page with Firebug and the display style (for modal) is set to block which means it should be showing.
I have modal windows working on another page in the site but I am calling this one in a different way and I can't figure out where I am going wrong!
My grid call is as follows:
$("#list").jqGrid({
url:'assets/includes/listPositions.cfm?PersonID=0',
datatype: 'json',
colNames:['ID','Position Code','Position Type','Parish Name','Start Date','Finish Date','CommitteeMemberTypeID','ClergyStatusID'],
colModel:[
{name:'tjppid',key: true,index:'tjppid',editable:true,editoptions:{readonly:true},width: 40},
{name:'PositionID',index:'PositionID',width:150},
{name:'PositionType',index:'PositionType',width: 250},
{name:'ParishName',index:'ParishName',width: 260},
{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:'CommitteeMemberTypeID',index:'CommitteeMemberTypeID', width:0,editable:true,edittype:'select',editoptions:{value:"<cfloop query="qCMType"><cfoutput>#MemberTypeID#:#MemberType#<cfif recordcount gt currentrow>;</cfif></cfoutput></cfloop>"}},
{name:'ClergyStatusID',index:'ClergyStatusID',width: 0,editable:true,edittype:'select',editoptions:{value:"<cfloop query="qClergyStatus"><cfoutput>#StatusID#:#Status#<cfif recordcount gt currentrow>;</cfif></cfoutput></cfloop>"}}],
sortname: 'PositionType',
sortorder: "asc",
viewrecords: true,
imgpath: 'assets/js/jqGrid/themes/sand/images',
jsonReader: {repeatitems: false},
height:120,
onSelectRow: function(id){
if(id && id!==lastsel2){
$('#list').restoreRow(lastsel2);
$('#list').editRow(id,true,pickdates);
lastsel2=id;
}
},
editurl: "assets/includes/assignPosition.cfm"
});
Any suggestions? Maybe there is an easier way to have a button that when clicked opens the modal form for adding a new row. The grid may have 0 or more rows already.
Cheers,
Dave
03:05

Moderators
30/10/2007

This happen in IE6/7 and with jQuery 1.2.6 ? - Right?
If this is the case there is a little bug in jqModal. Please switch to jQuery 1.2.3
untill the bug is corrected. I have implemented my solution for this but I'm not sure if this is the right way.
Regards
Tony
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.
Hi Tony,
Ignore that last post I checked the page on FF2 and it worked - I then checked it again on FF3 and it is now working - no code changed!! So
probably a problem with FF3 rather than the grid. After restarting FF3 the modal appears.
I have also discovered a sneaky way to hide a column whilst still allowing
it to be editable! Set the width to 0 in the ColModel[]!.
Cheers for a great plugin!
Dave
10:14

Moderators
30/10/2007

In the final release there will be a option to edit hidden fields in form editing
Regards
Tony
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.
06:25

Moderators
30/10/2007

Dave,
This is a partial solution, since if you dont want some hidden fields to be in form the would be.
I hope to publish the final 3.2 soon
Regards
Tony
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:
64 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