Forum

December 3rd, 2009
You must be logged in to post Login Register

Search Forums:


 






Adding timepickr to Edit Form

UserPost

01:09
06/10/2009


markalanevans

California

New Member

posts 2

I would like to use timepickr : http://haineault.com/media/jqu…..  when using the form editor. 


But for some reason it won't bind to the form field.     


if i create another input text elsewhere on the page(ie not a part of the Modal Form)  and give it an id of "testtime" and then ("#testtime").timepickr();   From within   dataInit: … The binding occurs… Its just not happening on the Edit Form.


Is there something i should know?


Current Code snippet, that doesn't work.


{
                        name:'time_start',
                        index:'time_start',
                        width:45,
                        editable:true,
                        editoptions:{
                            dataInit:function(el){
                                $(el).timepickr();
                            }

                        },
                        hidden:true,
                        editrules:{
                            edithidden:true
                        }
                    }


05:47
06/10/2009


tony

Sofia, Bulgaria

Member

posts 4606

Hello,

Some plugins require that the element should be into the DOM in order to work correct.

Since dataInit is applied not when the element is into the DOM, this maybe will not work.

The same will be if you try to use a jQuery UI datepicker with the option to show a calendar image.

(I will see in other releases how to correct this "bug").

In order to resolve your problem I recommend you to use the onInitilazeForm event:

The code cal look like this:

onInitializeForm : function(formid)

{

$("#time_start",formid).timepickr();

}


Reagrds

Tony

11:24
06/10/2009


markalanevans

California

New Member

posts 2

Post edited 03:09 – 07/10/2009 by markalanevans


Thanks Tony!  That was exactly the isssue. I added the code like you said:


.navGrid(
                '#s3pager',
                {    edit:true,
                    add:false,
                    del:false,
                    search:false,
                    refresh:true,
                    toggle:false,
                },{
                    editCaption:"Edit Event Details",
                    width:500,
                    jqModal:true,
                    closeOnEscape:true,
                    bSumbit:"Submit",
                    savekey:[true,13],
                    savekeys:[true,38,40],
                    onInitializeForm : function(formid){
                            $("#time_start",formid).timepickr();
                    }

                }
            )


And Voila! it worked.


Thanks so much!

-Mark


About the jQuery Grid Plugin forum

Most Users Ever Online:

60


Currently Online:

tim

phamtranquocviet

28 Guests

Forum Stats:

Groups: 1

Forums: 7

Topics: 3949

Posts: 14636

Membership:

There are 2486 Members

There have been 448 Guests

There is 1 Admin

There are 0 Moderators

Top Posters:

tony – 4606

markw65 – 179

YamilBracho – 124

Jim P – 95

Renso – 93

Pete – 86

Administrators: admin (24 Posts)




Ads by Lake Quincy Media
Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information