Forum


22:37

04/12/2009

Hi:
I'm usgin jqGrid 3.6.2. I have a grid that is loaded through json, one of the fields is a date. I need to be able to select it's value from a datepicker. Right now I got the datepicker working, but It wouldn't fire the post to actually update the data. I've been following the examples but couldn't make it. Any idea? Thanks!
13:21

Moderators
30/10/2007

Hello,
Sorry, not thing is clear for me here. Which edit module, how do you call datepicke and etc.
Could not help this way.
Best 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.
19:14

04/12/2009

Hi:
Let me put the code I'm using:
$("#milestone_dates_table41").jqGrid({
datatype: "json",
height: 'auto',
autowidth: true,
url: '/dashboard_dev.php/getMilestoneDates/41',
colModel:[
{name: 'id', hidden: true, index: 'id', editable: true },
{name:'f1', label: 'Milestone', sortable: false, id: 'milestone'},
{name:'f2', label: 'f2', sortable: false, editable: true, sorttype:"date", index: 'f2' },
],
onSelectRow: function(id) {
if(id && id!==lastsel_milestone41) {
jQuery('#milestone_dates_table41').jqGrid('restoreRow',lastsel_milestone41);
jQuery('#milestone_dates_table41').jqGrid('editRow', id, true, pickdates );
lastsel_milestone41=id;
}
},
imgpath: gridimgpath,
multiselect: false,
caption: "Milestone dates",
editurl: "/dashboard_dev.php/projectUpdateMilestoneDate?project_id=41",
rowList:[],
pager: "#milestone_dates_table41_pager"
}).navGrid("#milestone_dates_table41_pager", { add: false, edit: false, search: false, del: false } );
function pickdates(id){
jQuery("#"+ id + "_f2", "#milestone_dates_table41" ).datepicker( {dateFormat:"mm/dd/yy"} );
}
The problem is that the datepicker shows allright, but I have to hit the enter key several times in order to get the data posted to the server
18:25

Moderators
30/10/2007

Hello,
The datepicke need to be closed first and the submit the values. The same example is on demo page do you face the same problem?
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.
19:25

04/12/2009

Hi:
Actually I solved my problem in a not so fancy way, but still... what I did is this: I added a save and a cancel button next to the input field, so I have a way to trigger the save and restore methods.
I believe it would be good to have something like that as default when you specify "false" as usekeys options...
Another thing I had trouble with is that I had a model with several columns, in which the first wasn't supposed to be editable, but with that configuration the browser would do strange things with the datepicker, like only displaying the calendar after a few clicks inside the input box and switching to another window... The only way I figured to solve this was to make this column editable (id), but since it's hidden, it worked fine for me...
21:05

Moderators
30/10/2007

Hello,
I think that this is a datepicker configuration. Try to put just ...datepicker() without any options and see the result.
(Sometime i have this behavior and the solution was that I have set bad configurations to datepicker)
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