Forum


10:21

12/02/2009

Using jquery 1.3.1, jqgrid 3.4.1, Firefox 3.0.6, Fedora 10 (64-bit)
I was able to get a date picker working within the grid, but not within the 'add' input form. The code for the add is…
navGrid(”#pager”,
{refresh: true, edit: false, add: true, del: true, search: true},
{beforeSubmit: function() { alert('before edit submit'); } }, // edit
{ // add
beforeSubmit: function() { alert('before add submit'); return true;},
onInitializeForm : function(formid) {
jQuery(”#invdate”,formid).datePicker({
dateFormat:”yymmdd”,
clickInput:true,
createButton:false,
startDate:'2000-01-02'}).
addClass('date-pick'); // Mark grid's date fields
}
},
{ // delete
beforeSubmit: function() { alert('before delete submit'); }
}
);
Firebug tells me the input field on the add input form is….
<input id="invdate" class="FormElement dp-applied date-pick" type="text" name="invdate"/>
which is substantially similar to the working input of the grid…
<input id=”1_invdate“ class=”editable dp-applied date-pick“ type=”text“ style=”width: 98%;“ name=”invdate“/>
The input behaves as if the event is not firing. That is, clicking on the field performs no obvious action. What am I doing wrong?
Thanks!
01:10

Moderators
30/10/2007

Hello,
Check the z-index of datepicker. By default the z-index of the form is 950.
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.
12:06

12/02/2009

Tony,
The z-index was it. Thanks!
limbiz,
I'm not using the UI datePicker (spelled datepicker) but rather the plugin from http://www.kelvinluck.com/. No particular reason, it's just how I got started. If that is what you want, look at his datePicker page (http://www.kelvinluck.com/asse.....r/v2/demo/)
The basic process is to call his datePicker (capital 'P') method for the input field to which you wish to attach the picker and add the '' class. For example:
jQuery("#date").
datePicker({ dateFormat:"yymmdd",
clickInput:true,
createButton:false,
startDate:'2000-01-02'}).
addClass('date-pick'); // Mark grid's date fields
Hope that helps.
Most Users Ever Online: 715
Currently Online:
44 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