Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_Related Related Topics sp_TopicIcon
Using multiple instances of datepicker in a single editable row
30/11/2011
13:48
Avatar
Turukawa
New Member
Members
Forum Posts: 2
Member Since:
30/11/2011
sp_UserOfflineSmall Offline

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: "start_date", index: "start_date", width: 100, editable: true, sorttype:"date"},
            {name: "end_date", index: "end_date", width: 100, editable: true, sorttype:"date"},

And an onclick model:

    ondblClickRow: function(id){
        if(id && id!==projectselect){
            jQuery('#tracker').jqGrid('restoreRow',projectselect);
            jQuery('#tracker').jqGrid('editRow',id,true,pickdate);
            projectselect=id; }
        },

With the pickdate function:

function pickdate(id){
    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.

30/11/2011
20:20
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

01/12/2011
11:01
Avatar
Turukawa
New Member
Members
Forum Posts: 2
Member Since:
30/11/2011
sp_UserOfflineSmall Offline

Very peculiar.  I started my computer this morning, restarted the server and tested the system ... and it works.  Perhaps a cache that wasn't flushed?  I am using Firebug so will run again with the log and use that for flagging.  Thanks for the advice.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
38 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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information