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_TopicIcon
Can't get datepicker to post after selecting a date
08/01/2010
22:37
Avatar
mchojrin
Member
Members
Forum Posts: 11
Member Since:
04/12/2009
sp_UserOfflineSmall Offline

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!

10/01/2010
13:21
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

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.

11/01/2010
19:14
Avatar
mchojrin
Member
Members
Forum Posts: 11
Member Since:
04/12/2009
sp_UserOfflineSmall Offline

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

13/01/2010
18:25
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

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.

13/01/2010
19:25
Avatar
mchojrin
Member
Members
Forum Posts: 11
Member Since:
04/12/2009
sp_UserOfflineSmall Offline

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...

14/01/2010
21:05
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

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.

Forum Timezone: Europe/Sofia

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.com

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

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information