[jQuery] getting value out of datepicker

2008-04-24 Thread Amit Uchat
Hi,

I want to display some default date in a TextBox element.


I have bind datepicker to "startDate" with some default date On document
ready function.
jQuery('#startDate').datepicker({defaultDate: -7});
When I click on startDate input text box I do see datepicker control with
highlighted current date.
However the startDate textbox is still empty.
How can I add startdate that was highlighted in datepicker as default value
and apply that as date displayed in textbox(i.e. 4/23/2008) ?

I tried using following but it returns null :
alert(jQuery('#startDate').datepicker("getDate"));

Thanks in advance,
Amit



-- 
Know that you are special but be ordinary. -Sri Sri Ravisankar


[jQuery] Re: which query is most efficient?

2007-12-04 Thread Amit Uchat
Benjamin,
very good way to explain complex information. I would look forward to hear
more on your website.

On Dec 4, 2007 8:23 PM, Benjamin Sterling <[EMAIL PROTECTED]>
wrote:

> Dave, I know I am getting in here late, but I did a post on fast selectors
> that may point you in the right direction: 
> http://benjaminsterling.com/jquery-what-are-the-fastest-selector/
>
>
>
> On 12/4/07, Flesler <[EMAIL PROTECTED]> wrote:
> >
> >
> > There is, it's called slick speed.
> >
> > Ariel Flesler
> >
> > On 4 dic, 19:48, "Glen Lipka" <[EMAIL PROTECTED]> wrote:
> > > This would make a great page.  Put two selectors in and see which one
> > is
> > > faster.
> > > Glen
> > >
> > > On Dec 4, 2007 10:29 AM, sawmac <[EMAIL PROTECTED]> wrote:
> > >
> > >
> > >
> > >
> > >
> > > > > $('p span'): 863ms
> > > > > $('p').find('span'): 3050ms
> > >
> > > > Wow, that's a big difference.
> > > > Thanks Eric for running this test and thanks Gordon for pointing me
> > to
> > > > the Firebug profiler
> > >
> > > > cheers
> > >
> > > > --dave- Ocultar texto de la cita -
> > >
> > > - Mostrar texto de la cita -
> >
>
>
>
> --
> Benjamin Sterling
> http://www.KenzoMedia.com 
> http://www.KenzoHosting.com 
> http://www.benjaminsterling.com




-- 
Know that you are special but be ordinary. -Sri Sri Ravisankar


[jQuery] Re: jQuery improving performance

2007-12-03 Thread Amit Uchat
thank you all for quick and quality replys...
I am re-writing my script to accomodate new suggestions.
and profile my function again to check any improvement.

Thanks,
Amit

On Dec 3, 2007 10:36 AM, Dave Methvin <[EMAIL PROTECTED]> wrote:

>
>
> > I want to improve performance for following snipet when run for 1000
> times.
> >
> > jQuery(".Grid_Item,.Grid_AltItem").each( function() { //begin for-each
> TR
> > id = jQuery(this).find(".IdCell").text();
> > foo = jQuery(this).find("#foo").val();
> > bar = jQuery(this).find("#bar").val();
> > });
>
> Since there is no document.getElementsByClassName, that selector is
> going to take two complete passes through the entire document to get
> the two classes, then join the two result sets together. Since you are
> dropping into an .each() anyway, you might as well just get all TR
> elements and filter them yourself.
>
> The other uses of the jQuery selectors inside the .each() can be
> replaced by using the childNodes array of the TR directly.
>
> jQuery("#myTable tr").each( function() {
>   if ( !/Grid_Item|Grid_AltItem/.test(this.className) )
>  return;
>   var kids = this.childNodes;
>   var Id = jQuery(kids[2]).text();
>   var foo = kids[8].firstChild.value;
>   var bar = kids[9].firstChild.value;
>   
> });
>
> For fastest operation, you can substitute this for the Id line:
>
>   var Id = kids[2].textContent || kids[2].innerText;
>
> All of these optimizations only work if you guarantee that the table
> is laid out strictly as you specified. Otherwise you'll need to insert
> a bunch of error checks to make sure you don't follow empty firstChild
> objects etc.
>



-- 
Know that you are special but be ordinary. -Sri Sri Ravisankar