Forum
Topic RSS
17:10
07/02/2011
OfflineNeed Help Please! I have implemented a date picker on my JQGrid. The problem is that when the calender pops up and you select a date, and move to another cell, the date disappears. I had it working, but only when calling a reloadGrid from an onSelect function (EX #1 below). I've added other code to color code rows, and am having the same problem again.
EX #1
{name: 'effDT',index:'effDT', sorttype:"date", width:40, editable:true,
editoptions: {size: 10, maxlengh: 10,dataInit:{$(element).datepicker({onSelect: getDt(dateText, inst); }})}}},
function getDt(dateText, inst) {
jQuery(
"#permitList").trigger("reloadGrid");
}
I found an entry on the forum from Tony that said to call the SetTimeout function to correct this error (EX #2 below), but now the calender doesn't pop up at all.
EX #2
{name:'effDT',index:'effDT', sorttype:"date", width:40, editable:true,function(element)
editoptions: {size: 10, maxlengh: 10,dataInit: setTimeout({$(element).datepicker()},300)}},
Please help to get this working.
Jennifer
19:18
10/08/2009
OfflineIt seems to me that you use dataInit function in absolutely wrong way.
$(elem).datepicker();
}
or something like
setTimeout(function(){
$(elem).datepicker();
}, 100);
}
Please compare both examples with your code.
Moreover I see no sense to call reload the full grid just if the user select date: you use jQuery("#permitList").trigger("reloadGrid"); which do this.
Best regards
Oleg
19:33
07/02/2011
OfflineThank you. I changed my datainit to
{name:'effDT',index:'effDT', sorttype:"date", width:40, editable:true,function (elem) {
editoptions: {size: 10, maxlengh: 10,dataInit:
$(elem).datepicker();}}},
It still does not keep the date that's selected from the calendar once you move off of the cell. Any ideas?
Hello,
Please use setTimeout when set datepicker.
Please look the red text here :
http://www.trirand.com/jqgridw.....ditoptions
I'm not sure that all documentation is updated.
Regards
Tony
16:03
07/02/2011
OfflineWas able to get the datepicker to open with this code:
{name:'effDT',index:'effDT', sorttype:"date", width:40, editable:true,
editoptions: {size: 10, maxlengh: 10,dataInit:function(element)
{$(element).datepicker()}}},
I was then getting 'URL not set' error, so I added this code to the grid definition:
editurl:'url',
cellsubmit:'clientArray',
Now have new issue with date not getting set when user doesn't click elsewhere in grid. See new post.
Most Users Ever Online: 994
Currently Online:
10 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
Log In
Home