Forum



13:48

30/11/2011

I have only a rudimentary knowledge of jQuery (usually program in Python) so forgive me if there is an obvious answer to this. I have a table with two instances of a date (start and end for a project).
colModel:
{name: "end_date", index: "end_date", width: 100, editable: true, sorttype:"date"},
And an onclick model:
if(id && id!==projectselect){
jQuery('#tracker').jqGrid('restoreRow',projectselect);
jQuery('#tracker').jqGrid('editRow',id,true,pickdate);
projectselect=id; }
},
With the pickdate function:
jQuery("#"+id+"_start_date","#tracker").datepicker({dateFormat:"yy-mm-dd"});
jQuery("#"+id+"_end_date","#tracker").datepicker({dateFormat:"yy-mm-dd"});
}
When I edit then only the start_date cell has the datepicker (or the other way round if I swap whichever is called first). I realise this probably has something to do with the id not being unique but I've no idea how to check this.
I would also like to check whether the start_date is less than the end_date, but that isn't as critical as simply getting the two instances to work.
Apologies if this has been asked elsewhere but I couldn't find any answers on this.
Thanks and any help much appreciated.
20:20

Moderators
30/10/2007

Hello,
I do not see a problem here.
You can use FireBug in FireFox (Chrome has also such tool) to see what is happen.
You can do (Valid only in FireFox)
console.log( varaible )
With other words
function pickdate(id){
console.log( id);
jQuery("#"+id+"_start_date","#tracker").datepicker({dateFormat:"yy-mm-dd"});
jQuery("#"+id+"_end_date","#tracker").datepicker({dateFormat:"yy-mm-dd"});
}
I'm curious. Could you please replace the places of the calling in order to see the result?
function pickdate(id){
jQuery("#"+id+"_end_date","#tracker").datepicker({dateFormat:"yy-mm-dd"});
jQuery("#"+id+"_start_date","#tracker").datepicker({dateFormat:"yy-mm-dd"});
}
Or just bind it to the end date only.
Please look if you have put other name – i.e some missspeling error in the name or etc
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:
62 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