Thanks Tony,
I removed my events but that didn’t fix it. In fact I stripped out all the edit/add/delete options and the problem persisted. I also changed hidden to false on that row and the text actually displays correctly in the grid, just not initially in the dialog. Is there something going on with the modal dialog perhaps?
Here is the full text of my jqGrid:
$(“#list1”).jqGrid({
url: ‘ c.ListJSON())%>’,
datatype: ‘json’,
mtype: ‘GET’,
altRows: true,
hidegrid: false,
toolbar: [true, ‘top’],
colNames: ,
colModel: [
{ name: ‘id’, index: ‘id’, width: 55, resizable: true, hidden: true, editable: false, editoptions: { readonly: true, size: 10} },
{ name: ‘date’, index: ‘date’, width: 120, resizable: true, sorttype: “date”, editable: true, editoptions: { size: 20 }, editrules: { required: true} },
{ name: ‘expiredate’, index: ‘expiredate’, width: 120, resizable: true, sorttype: “expiredate”, editable: true, editoptions: { size: 20 }, editrules: { required: true} },
{ name: ‘title’, index: ‘title’, width: 500, resizable: true, editable: true, editoptions: { size: 50 }, editrules: { required: true} },
{ name: ‘text’, index: ‘text’, width: 120, hidden: true, sortable: false, resizable: true, editable: true, edittype: “textarea”, editoptions: { rows: “10”, cols: “60” }, editrules: { edithidden: true} },
],
pager: jQuery(‘#pager1’),
rowNum: 10,
rowList: [1, 5, 10, 20, 30],
viewrecords: true,
multiselect: false,
sortname: ‘Date’,
sortorder: “desc”,
imgpath: ”,
caption: ‘Announcements’
}).navGrid(‘#pager1’, // Pager div
{add: true, edit: true, del: true }, // Options
{height: 280, width: 500, reloadAfterSubmit: true, // Edit Options
modal: true, closeAfterEdit: true,
url: ‘ c.Edit())%>’,
onInitializeForm: function(formid) {
$(“#date”, formid).datepicker({ showOn: ‘button’ });
$(“#expiredate”, formid).datepicker({ showOn: ‘button’ });
},
afterSubmit: function(serverStatus, aPostData) {
var respuesta = serverStatus.responseText;
return [false, respuesta, “”];
}
},
{ height: 280, width: 500, reloadAfterSubmit: true, // Add options
modal: true, closeAfterAdd: true,
url: ‘ c.Add())%>’,
onInitializeForm: function(formid) {
$(“#date”, formid).datepicker({ showOn: ‘button’ });
$(“#expiredate”, formid).datepicker({ showOn: ‘button’ });
},
afterSubmit: function(serverStatus, aPostData) {
var respuesta = serverStatus.responseText;
return [false, respuesta, “”];
}
},
{ reloadAfterSubmit: true, // Delete options
modal: true,
url: ‘ c.Delete())%>’
}
);
});
OK that sorted that problem out. Thank you. Turns out the datepicker-div was set to 20 or 30 z-index. Took some digging with FireBug to figure that out. Now it shows up properly.
However I’ve discovered another issue. I have two date fields, one right after the other. If I use the onfocus event, I get them to pop-up, but the second one always seems to populate the first. Actually what happens is I click in the second, the picker pops up, I select a date, it goes away and the first one immediately pops up WITHOUT changing the value of the second text box. If I use the button function, everything works.
Additionally, the onFocus fires when the form loads and I get a datepicker showing right away. This is actually not unexpected since one of the date elements is the first form field so this is probably functioning as usual.
I prefer the button option personally so I’ll use that, but it was a little odd.
Thanks!
Jack
OK I messed around some more and got closer. Turns out I had the CSS file missing or something, so it is now displaying…sort of.
1) It renders BEHIND the form window.
2) when I click on a date, it closes the form window not quite what I want.It appears it is doing a close and not a save (ovbiouslly) since the value never changes.
I believe I’m using jqGrid 3.3 as I just downloaded this the other day.
Update: Further messing around seems to indicate my problems are with the datepicker appearing behind the edit form. Attempts to tweak z-order have failed (but I believe this was corrected?).
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top