[jQuery] Re: jQuery(this + child) ?

2009-02-26 Thread Tze Yang Ng

Try the following:

jQuery(.class).click(function() {
  jQuery('a',this).toggleClass(highlighted);
}

Cheers

==

On Thu, Feb 26, 2009 at 7:46 PM, Kenchu sweken...@gmail.com wrote:

 Is there a way to do what I describe in topic?

 For example.

 jQuery(.class).click(function()
 {
        jQuery(this + a).toggleClass(highlighted);
 });

 This doesnt work. What im trying to do is to select all the a
 elements within this. Is it possible to achive that somehow?




-- 
http://ngty77.blogspot.com


[jQuery] Re: How can I rebind this event after a ajax callback?

2009-02-25 Thread Tze Yang Ng

How abt restructuring ur code to something like this:

function do_blur_binding() {
  // ...
  $(novoConteudo).blur(function() {
// ...
$.ajax({
   // ...
   success: function() {
 // ...
 do_blur_binding();
   }
 });
}

function editaVal(celDiv, id) {
  // ...
  do_blur_binding();
}

:] TY

==

On Thu, Feb 26, 2009 at 1:40 PM, AndreMiranda acymira...@gmail.com wrote:

 Hi everyone!

 I'm trying to create a text edit in place myself just by manipulating
 jQuery selectors. But, after the first ajax callback, the others
 callback for the same input text doesn't work anymore...

 I've tried to use livequery plugin but it didn't work...

 function editaVal(celDiv, id)
    {
        var novoConteudo = $(input type='text' id='novoCont + id +
 ' value=' + $(celDiv).html() + ' /);
        $(celDiv).dblclick(function()
        {
            $(this).html(novoConteudo);
        });

        $(novoConteudo).blur(function()
        {
            $(novoConteudo).parents(tr).removeClass('trSelected');
            $.ajax({
                type: 'POST',
                url: '/SuperAdmin/SalvaValor/?busca=' + $
 (novoConteudo).val() + 'codValor=' + id,
                beforeSend: function()
                {
                    $(celDiv).html($(#loading).show());
                },
                success: function()
                {
                    $(celDiv).html($(#loading).hide());
                    $(celDiv).html(novoConteudo.val());
                }
            });
        });
    }

 My question is: how can i rebind this??? Rebind the blur event... When
 I blur the input text, nothing happens on the second ajax callback.
 Thanks!!
 Andre Miranda





-- 
http://ngty77.blogspot.com


[jQuery] Re: Datepicker Plugin Quesiton

2009-02-16 Thread Tze Yang Ng

I guess it is just a habit on my part, acessing the online docs can be
slow at times from my china office.

==

On Mon, Feb 16, 2009 at 5:15 PM, Richard D. Worth rdwo...@gmail.com wrote:

 On Sun, Feb 15, 2009 at 9:21 PM, Tze Yang Ng ngt...@gmail.com wrote:

 minDate: new Date()

 When i use the datepicker, i have the habit of digging through
 package/ui/ui.datepicker.js to find out the options supported.

 The Datepicker is documented quite well:

 Stable (1.5.3):
 http://docs.jquery.com/UI/API/1.5.3/Datepicker/datepicker

 Preview (1.6rc6):
 http://docs.jquery.com/UI/Datepicker#options

 - Richard




-- 
http://ngty77.blogspot.com


[jQuery] Re: Datepicker Plugin Quesiton

2009-02-15 Thread Tze Yang Ng

minDate: new Date()

When i use the datepicker, i have the habit of digging through
package/ui/ui.datepicker.js to find out the options supported.

==

On Sat, Feb 14, 2009 at 10:21 PM, Hellofrom hellof...@gmail.com wrote:
 Hello every one
 Can some one help me setting the datepicker plugin with the following
 options
 min date =today
 date format =-mm-dd

 thanks





-- 
http://ngty77.blogspot.com


[jQuery] Re: Working with identical objects

2009-02-15 Thread Tze Yang Ng

According to the jquery doc, $('option:selected',
ModulesListObj).val() returns the content of the value attribute of
the first matched element.

U may wish to try something like the following to get the desired array:

$('something', ModulesListObj).map(function(){
  return $(this).val();
});

TY

==

On Mon, Feb 16, 2009 at 10:33 AM, ShurikAg shuri...@gmail.com wrote:

 Actually this:
 alert(jQ(option:selected, ModulesListObj).val())

 works perfectly right, if there is only one select object on the page.
 If there are two or more it always picks up the first one.

 On Feb 15, 1:04 pm, Ricardo Tomasi ricardob...@gmail.com wrote:
 That's quite a lot of code to read through in an email. Try reducing
 your code to the least necessary to exemplify your problem, then
 someone might take the time to help.

 From what I see:
 alert(jQ(option:selected, ModulesListObj).val())

 This is catching all the selected options inside ModulesListObj, and
 that will be one option for every select you added. val() will then
 return the value only for the first element in that collection. That
 should probably be:

 alert(jQ(option:selected, this).val())

 cheers,
 - ricardo

 On Feb 12, 11:53 pm, ShurikAg shuri...@gmail.com wrote:

  I don't believe that nobody have any suggestion...



-- 
http://ngty77.blogspot.com


[jQuery] Re: .load() and timing

2009-02-15 Thread Tze Yang Ng

any code fragment to look at ? not the whole chunk, just the part
focusing on the part u are referring to.

==

On Mon, Feb 16, 2009 at 1:05 PM, jhm jmay...@gmail.com wrote:

 I'm new to jquery and so far it's awesome. I've run into a problem,
 however, that I don't fully understand how to deal with. (sorry for
 the cross post, if it is one, I accidentally posted this originally in
 the UI group).

 I'm using .load() to load a snippet of HTML in response to a click. I
 need to modify the HTML, based on what was clicked. Even though I do
 the modifications after the snippet is loaded, the modifications seem
 to operate on the initial HTML instead of the freshly loaded code.

 I figure there is a timing issue I'm missing, but I also figure this
 must be possible.

 Any advice?

 Thanks!




-- 
http://ngty77.blogspot.com


[jQuery] Re: any way to combine this with additional selectors?

2009-02-11 Thread Tze Yang Ng

 hi i have the following problem: is there any way to combine this in
 a selector like $(this) with additional selectors like $(this+
 span.hello) ?

Are u thinking abt applying context to the selector 'span.hello'? If
that is the case, u can do something like this:

$('span.hello',$(this))

Cheers

-- 
http://ngty77.blogspot.com


[jQuery] Re: Jquery seems to be sending two requests the first few times. . .

2009-02-10 Thread Tze Yang Ng

Hi Mark,

 I have been tracing this one down for two days.

 Has anyone else ever seen jquery making multiple request for a single
 call?

Is it possible that u register an event multiple times ? Something
like the following:

function register_button_for_action() {
  $('button').load( 'any_url', register_button_for_action);
}

Regards
-- 
http://ngty77.blogspot.com