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

Moderator

posts 5864

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 00: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

19:03
11/02/2010


Cael

São Paulo – Brazil

Member

posts 5

Post edited 17:56 – 11/02/2010 by Cael


Hi Tony


Is there any chance to add the timepickr plugin in "inline editing" mode? I may be wrong, but the onInitializeForm is only trigged when you're using the Edit Window – opened by a click in a nav button.


As I was using the inline cell editing, I thought it would be easier to check with you if there's any update on this issue.

22:37
11/02/2010


Cael

São Paulo – Brazil

Member

posts 5

Post edited 20:40 – 11/02/2010 by Cael


BTW, I was reading the documentation when I got the following [about the dataInit function]:

"(…) This is ideal way of attaching datepicker, timepicker and other."


As you have noticed in my last comment, it didn't work for me… :-(

EDIT: I am using the latest version [3.6.3] w/ multiselect

Am I missing something here? Do you have any suggestion about using some plugins [timepicker, at least] in inline edit? Do you plan to add another function that gives the element already in the DOM?


Thanks and congrats for this amazing plugin.

Cael

15:04
12/02/2010


tony

Sofia, Bulgaria

Moderator

posts 5864

Hello,

Please refer here:

http://www.trirand.com/blog/?p…..p;search=1


Best Regards

Tony

18:31
12/02/2010


Cael

São Paulo – Brazil

Member

posts 5

Thanks Tony, that worked!


Cael


About the jQuery Grid Plugin forum

Most Users Ever Online:

76


Currently Online:

37 Guests

Forum Stats:

Groups: 1

Forums: 7

Topics: 5522

Posts: 19481

Membership:

There are 3584 Members

There have been 448 Guests

There is 1 Admin

There are 2 Moderators

Top Posters:

OlegK – 208

markw65 – 179

phicarre – 126

YamilBracho – 124

Renso – 109

Jim P – 101

Administrators: admin (35 Posts)

Moderators: tony (5864 Posts), Rumen[Trirand] (81 Posts)




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