[jQuery] Re: Learning about functions and methods (I am confused)

2009-04-08 Thread Geuintoo

Great, thank you!!


[jQuery] Re: Learning about functions and methods (I am confused)

2009-04-08 Thread Geuintoo

But how to extend a sub method?

// Extend sub method
$.extend({

  $.myPlugin = {
  myExtendedMethod: function(){ alert('Extended submethod
called'); }
   }
});

// Won't work:
$.myPlugin.myExtendedMethod();

Thanks for any tipp!


[jQuery] Re: JQuery, JqGrid, and Ajax

2009-04-08 Thread Tony
Hello,
Basically jqGrid first check if the grid exists.
If the grid does not exists the plugin create the grid and data is
populated.
If the grid exists nothing is happen.
In other words you try to call every time jqGrid on already created
grid.
To avoid this there are a lot of scenarious.
1. Create a empty second grid and hide them (if you want)
2. Then after every double click do something like this

jQuery(#list3).setGridParam({url:'get_services.php?name='+x}).trigger
(reloadGrid)

Best Regards
Tony

On Apr 7, 10:21 pm, Natkeeran L.K. natkee...@gmail.com wrote:
 Hello:

 I am trying to develop a similar functionality as here:http://
 koshersavings.ca/SelectItems.php

 When the user to clicks an row item, I want items to be loaded based
 on the selection, dynamically.

 I am trying to do the same, but usingjqgrid, and ajax.

 The current code is here:  (also note 
 below)http://pssnet.com/~devone/ajqtable/summary35.html

 Basically, when the user double clicks it loads a corresponding
 table.  But, when they select another, it will not reloaded.  Any help
 appreciated.  Thanks.

 Regards,
 Nat

     ondblClickRow: function(id){
                 var x = id;
                 alert(You double click row with id: +id);

                         // Load Dynamic Data
                 jQuery(#list3).jqGrid({
                                 datatype: function(postdata){
                                         jQuery.ajax({
                                         url:'get_services.php?name='+x,
                                         data:postdata,

                                         datatype: json,
                                         complete: function (jsondata, stat){
                                                         if(stat==success){
                                                         var thegrid = 
 jQuery(#list3)[0];
                                                         
 thegrid.addJSONData(eval((+jsondata.responseText+)));
                                                                         
 alert(yes);
                                                                         }
                                                                 else{
                                                                         
 alert(no);
                                                                         }
                                                                 } // end 
 complete
                                                 }); // end ajax
                                                 }, // end datatype

                         colNames:['Product No', 'Name', 'type'],

                         colModel:[

                                 {name:'product_id',index:'product_id', 
 width:75},

                                 {name:'name',index:'name', width:100},

                                 {name:'type',index:'type', width:100},

                                 ],

                         pager: jQuery('#pager3'),

                         rowNum:10,

                         rowList:[10,20,30],

                         imgpath: 'themes/sand/images',

                         sortname: 'id',

                         viewrecords: true,

                         sortorder: asc
                         });

                         },  //end ondblClickRow function

[jQuery] Re: Learning about functions and methods (I am confused)

2009-04-08 Thread Jordon Bedwell

Try:

$.extend({
myPlugin:{
myExtend:function() {
alert('This');
}
}
});
$.myPlugin.myExtend();


-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of Geuintoo
Sent: Wednesday, April 08, 2009 1:39 AM
To: jQuery (English)
Subject: [jQuery] Re: Learning about functions and methods (I am confused)


But how to extend a sub method?

// Extend sub method
$.extend({

  $.myPlugin = {
  myExtendedMethod: function(){ alert('Extended submethod
called'); }
   }
});

// Won't work:
$.myPlugin.myExtendedMethod();

Thanks for any tipp!



[jQuery] Re: Jquery makes two ajax requests in one!!

2009-04-08 Thread Skyblaze

this is very very strange...any ideas?

On Apr 8, 1:52 am, Skyblaze marcomenozz...@gmail.com wrote:
 ok i did that and i have only one alert box so the event is fired
 once. So what is that fires two same ajax get request?

 On Apr 8, 1:00 am, James james.gp@gmail.com wrote:

  Try adding an alert or console.log in your change event (not inside
  your ajax success callback) to debug whether the change event is
  actually being called once or twice.

  On Apr 7, 12:23 pm, Skyblaze marcomenozz...@gmail.com wrote:

   I have no other id with that name and also with firebug suspended it
   is the same.always the same ajax/get request...two identical ajax
   get request one after the other

   On Apr 7, 8:31 pm, Rick Faircloth r...@whitestonemedia.com wrote:

Make sure you don't have another id called #comprensori_id.
I had some code left over from experimentation on a page that
I failed to clear off and every time a certain ajax function ran,
it did so twice!

Rick

-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On

Behalf Of Skyblaze
Sent: Tuesday, April 07, 2009 12:31 PM
To: jQuery (English)
Subject: [jQuery] Jquery makes two ajax requests in one!!

I have a strange problem. I have to do an ajax request after a select
box changes (change event) so i have the following code:

$('#comprensori_id').change(function() {
                        var comprensorio_id = $(this).val();
                        $.ajax({
                                   type: GET,
                                   url: ,
                                   data: comprensorio_id= +
comprensorio_id,
                                   success: function(data, msg){
                                $('#comuni_id').empty();
                                $('#comuni_id').append(data);
                                   }
                                 });
                });

the problem is that when i change the select box selection my browser
makes two consecutives same ajax request and i can't figure out
why...this is very strange


[jQuery] Re: JQuery, JqGrid, and Ajax

2009-04-08 Thread Tony

Hello again,
Sorry missed that you have datatype as function.
The 2 should be just

var x;
.
ondblClickRow: function(id){
x =id;
.
jQuery(#list3).trigger(reloadGrid);
..
}

On Apr 8, 10:43 am, Tony t...@trirand.com wrote:
 Hello,
 Basically jqGrid first check if the grid exists.
 If the grid does not exists the plugin create the grid and data is
 populated.
 If the grid exists nothing is happen.
 In other words you try to call every time jqGrid on already created
 grid.
 To avoid this there are a lot of scenarious.
 1. Create a empty second grid and hide them (if you want)
 2. Then after every double click do something like this

 jQuery(#list3).setGridParam({url:'get_services.php?name='+x}).trigger
 (reloadGrid)

 Best Regards
 Tony

 On Apr 7, 10:21 pm, Natkeeran L.K. natkee...@gmail.com wrote:

  Hello:

  I am trying to develop a similar functionality as here:http://
  koshersavings.ca/SelectItems.php

  When the user to clicks an row item, I want items to be loaded based
  on the selection, dynamically.

  I am trying to do the same, but usingjqgrid, and ajax.

  The current code is here:  (also note 
  below)http://pssnet.com/~devone/ajqtable/summary35.html

  Basically, when the user double clicks it loads a corresponding
  table.  But, when they select another, it will not reloaded.  Any help
  appreciated.  Thanks.

  Regards,
  Nat

      ondblClickRow: function(id){
                  var x = id;
                  alert(You double click row with id: +id);

                          // Load Dynamic Data
                  jQuery(#list3).jqGrid({
                                  datatype: function(postdata){
                                          jQuery.ajax({
                                          url:'get_services.php?name='+x,
                                          data:postdata,

                                          datatype: json,
                                          complete: function (jsondata, stat){
                                                          if(stat==success){
                                                          var thegrid = 
  jQuery(#list3)[0];
                                                          
  thegrid.addJSONData(eval((+jsondata.responseText+)));
                                                                          
  alert(yes);
                                                                          }
                                                                  else{
                                                                          
  alert(no);
                                                                          }
                                                                  } // end 
  complete
                                                  }); // end ajax
                                                  }, // end datatype

                          colNames:['Product No', 'Name', 'type'],

                          colModel:[

                                  {name:'product_id',index:'product_id', 
  width:75},

                                  {name:'name',index:'name', width:100},

                                  {name:'type',index:'type', width:100},

                                  ],

                          pager: jQuery('#pager3'),

                          rowNum:10,

                          rowList:[10,20,30],

                          imgpath: 'themes/sand/images',

                          sortname: 'id',

                          viewrecords: true,

                          sortorder: asc
                          });

                          },  //end ondblClickRow function


[jQuery] Re: live() not working in IE8?

2009-04-08 Thread Dayjo

The solution I made for this problem is to put the .change() function
inside a function called DOMReload() along side other similar
functions, then.. whenever I do any ajax calls or loads() I run
DOMReload() so that the function is re-applied to all new elements.

It's a shame that live doesn't work with these events, and its a shame
that jquery doesnt have a $(dom.reload)  function instead of or as
well as $(document.ready).



On Mar 12, 1:27 am, Dave Methvin dave.meth...@gmail.com wrote:
  $('#orderlineform #product_id').live('change',isRentalActive);

 The change event isn't one of the ones supported by .live(), in fact
 it's specifically documented as not supported:

 http://docs.jquery.com/Events/live#typefn

 The .live() method requires events to bubble to the document level
 where they're handled. The reason your code works fine in Firefox and
 others is because they do the right thing and bubble the change event
 as specified by the W3C. IE, on the other hand...do we really need to
 finish this sentence?  :-)


[jQuery] Re: live() not working in IE8?

2009-04-08 Thread Dayjo

However I have recently been noticing IE 8 Beta having issues with the
live('click') event... could be the fact I'm using Windows 7 IE 8
beta... but who knows!

On Apr 8, 9:30 am, Dayjo dayjoas...@gmail.com wrote:
 The solution I made for this problem is to put the .change() function
 inside a function called DOMReload() along side other similar
 functions, then.. whenever I do any ajax calls or loads() I run
 DOMReload() so that the function is re-applied to all new elements.

 It's a shame that live doesn't work with these events, and its a shame
 that jquery doesnt have a $(dom.reload)  function instead of or as
 well as $(document.ready).

 On Mar 12, 1:27 am, Dave Methvin dave.meth...@gmail.com wrote:

   $('#orderlineform #product_id').live('change',isRentalActive);

  The change event isn't one of the ones supported by .live(), in fact
  it's specifically documented as not supported:

 http://docs.jquery.com/Events/live#typefn

  The .live() method requires events to bubble to the document level
  where they're handled. The reason your code works fine in Firefox and
  others is because they do the right thing and bubble the change event
  as specified by the W3C. IE, on the other hand...do we really need to
  finish this sentence?  :-)


[jQuery] Re: Jquery makes two ajax requests in one!!

2009-04-08 Thread Skyblaze

I already tried to debug with firebug and i saw that the callback
(with the ajax request code in it) in the event handler function is
just called once. Then i also putted an alert in the event handler and
as i said before i see in output only one alert box so the event
handler callback is just called once. I don't change anything in the
origjnal selectbox


On Apr 8, 10:49 am, Joseph Le Brech jlebr...@hotmail.com wrote:
 Can you put a breakpoint to see if it runs change twice?

 Do you change the value and the text or something similar?



  Date: Wed, 8 Apr 2009 00:49:45 -0700
  Subject: [jQuery] Re: Jquery makes two ajax requests in one!!
  From: marcomenozz...@gmail.com
  To: jquery-en@googlegroups.com

  this is very very strange...any ideas?

  On Apr 8, 1:52áam, Skyblaze marcomenozz...@gmail.com wrote:
   ok i did that and i have only one alert box so the event is fired
   once. So what is that fires two same ajax get request?

   On Apr 8, 1:00áam, James james.gp@gmail.com wrote:

Try adding an alert or console.log in your change event (not inside
your ajax success callback) to debug whether the change event is
actually being called once or twice.

On Apr 7, 12:23ápm, Skyblaze marcomenozz...@gmail.com wrote:

 I have no other id with that name and also with firebug suspended it
 is the same.always the same ajax/get request...two identical ajax
 get request one after the other

 On Apr 7, 8:31ápm, Rick Faircloth r...@whitestonemedia.com wrote:

  Make sure you don't have another id called #comprensori_id.
  I had some code left over from experimentation on a page that
  I failed to clear off and every time a certain ajax function ran,
  it did so twice!

  Rick

  -Original Message-
  From: jquery-en@googlegroups.com 
  [mailto:jquery...@googlegroups.com] On

  Behalf Of Skyblaze
  Sent: Tuesday, April 07, 2009 12:31 PM
  To: jQuery (English)
  Subject: [jQuery] Jquery makes two ajax requests in one!!

  I have a strange problem. I have to do an ajax request after a 
  select
  box changes (change event) so i have the following code:

  $('#comprensori_id').change(function() {
  á á á á á á á á á á á á var comprensorio_id = $(this).val();
  á á á á á á á á á á á á $.ajax({
  á á á á á á á á á á á á á á á á á átype: GET,
  á á á á á á á á á á á á á á á á á áurl: ,
  á á á á á á á á á á á á á á á á á ádata: comprensorio_id= +
  comprensorio_id,
  á á á á á á á á á á á á á á á á á ásuccess: function(data, msg){
  á á á á á á á á á á á á á á á á $('#comuni_id').empty();
  á á á á á á á á á á á á á á á á $('#comuni_id').append(data);
  á á á á á á á á á á á á á á á á á á}
  á á á á á á á á á á á á á á á á á});
  á á á á á á á á });

  the problem is that when i change the select box selection my 
  browser
  makes two consecutives same ajax request and i can't figure out
  why...this is very strange

 _
 View your Twitter and Flickr updates from one place – Learn 
 more!http://clk.atdmt.com/UKM/go/137984870/direct/01/


[jQuery] Re: Comma sign makes imperfect...

2009-04-08 Thread Jayandes

When you start writing in the input box, the string you are entering
must be equal to a subset of one or many strings in the array, if not
the autocompleter wipes out the text you have written. Take a look
into Jörn's example page (http://jquery.bassistance.de/autocomplete/
demo/) for more info.

/J

On 7 Apr, 23:10, donb falconwatc...@comcast.net wrote:
 mustmatch doesn't even appear in the API documentation.  What's it
 supposed to do?

 On Apr 7, 11:24 am, Jayandes jonas.sun...@gmail.com wrote:

  Hi, again.

  I did some more dissecting on the option settings and found out that
  mustMatch feature won't work at all. So, I striped that one out and
  they lived happily ever after But, I could really use that
  feature in either case.

  On 7 Apr, 12:09, Jayandes jonas.sun...@gmail.com wrote:

   Hey, guys.

   I'm been pulling my hair for quite a while. Basically, I have serious
   issues with Jörn's autocompleter and it's all my fault I think, but I
   really can't point out what's causing the error.

   The expected functionality is like this
   ---

   1. User enters textbox #media_
   2. The textbox's text is selected
   3. User begins selecting from the list, let's say Cinderella.
   4. Cinderella gets selected in the text box and a thumbnail is shown
   in a div below the input box
   5. The id of Cinderella (see object array list below) is set to #media
   6. User continues, #media_ becomes out of focus

   Some default behavior are included
   ---
   IF the textbox's text are deleted by the user and steps on to step 6,
   #media_ text becomes No media and #media_ becomes 0.

   Actual behavior
   ---
   Works for all title strings in the object array, EXCEPT for those
   which holds a comma sign, eg. Baddbaddrens, DBS. What happens is
   that the title gets selected and when I step out of the UI element
   (click or tab to next) the text in #media_ get's wiped out, but #media
   still holds its value. I also have a hard time trying to locate the
   issue with the console.

   The behavior is equal for a similar autocompleter I have for the
   customer (if the customer name has a comma sign).

   I've modified Jörn's example of email selection and included a couple
   of comma sign in the data set, but it turned out alright, so the
   glitch must be on my side...

   Would be most grateful for a quick resolution on this one! Thanks in
   advance!

   Jonas

   Source code included below
   ---

   !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN http://www.w3.org/
   TR/html4/strict.dtd
   html xml:lang=sv xmlns=http://www.w3.org/1999/xhtml;
   lang=svhead
   meta http-equiv=content-type content=text/html;
   charset=ISO-8859-1
   titleSystem - add document/title
   link rel=stylesheet type=text/css href=reset-fonts-grids.css
   link rel=stylesheet type=text/css href=base.css
   link rel=stylesheet type=text/css href=main.css
   script type=text/javascript src=/lib/jquery.js/script
   link rel=stylesheet type=text/css href=/css/
   jquery.autocomplete.css /
   script type='text/javascript' src='/lib/jquery.autocomplete.js'/
   script
   script type='text/javascript' src='/lib/jquery.bgiframe.min.js'/
   script
   script type='text/javascript' src='/lib/jquery.dimensions.js'/
   script

   link rel=stylesheet type=text/css href=ui.css

   script type=text/javascript
           var mediasJS = [
                   { title: No media, id: 0, thumb: nomedia.jpg},
                   { title: Cinderella, id: 33, thumb:
   pepparkaka.png},
                   { title: Andersons, id: 34, thumb:
   anderssons.png},
                   { title: Baddbaddrens, DBS, id: 35, thumb:
   baddbaddrens.png},
                   { title: Baddbaddrens ali, id: 36, thumb:
   machuset-ipod.png},
                   { title: Bilpunkten, id: 39, thumb:
   bilpunkten.png},
           ];
   /script
   script type=text/javascript
   $().ready(function() {

       $(#media_).autocomplete(mediasJS, {
           minChars: 2,
           width: 400,
           highlight: false,
           scroll: true,
           scrollHeight: 300,
           matchContains: true,
           mustMatch: true,
           formatItem: function(row, i, max) {
               return  img src='/multimedia/ + row.thumb + '/  +
   row.title +  (id:  + row.id + ); },
           formatMatch: function(row, i, max) { return row.title; },
           formatResult: function(row) {        return row.title; }
       });

       $(#media_).result(function(event, data, formatted) {
           if (data){
                   $(#media).val(data[id]);
                   $(#media_).val(data[title]); /* No major
   difference with this one included or not */
                   $(#mediathumb).css(background, url('/
   multimedia/+data[thumb]+') no-repeat);
                   

[jQuery] addClass on ahref link on the fly

2009-04-08 Thread Aysseline


Hi

I've got a  list of image with links and need to add a class on the fly on
the ahref link. The output is like that
ul
li http://www.site.com/  http://www.imageurl.com/img.png  /li
li http://www.site.com/  http://www.imageurl.com/img.png  /li
li http://www.site.com/  http://www.imageurl.com/img.png  /li/ul

and I want this (class=tooltip2) :
ul
li http://www.site.com/  http://www.imageurl.com/img.png  /li
li http://www.site.com/  http://www.imageurl.com/img.png  /li
li http://www.site.com/  http://www.imageurl.com/img.png  /li/ul

I need to do this because all is auto-generated I can only add this class
with jQuery. I tried different code but my knowledge isn't sufficient

jQuery(.gallery li a[href^='url']).addClass(tooltip); or
jQuery(.gallery li a).each(function() {
jQuery(this).attr(href).addClass(tooltip); });

and many other tricks doesn't work. I need help to achieve this, thanks
-- 
View this message in context: 
http://www.nabble.com/addClass-on-ahref-link-on-the-fly-tp22946637s27240p22946637.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: addClass on ahref link on the fly

2009-04-08 Thread Aysseline


Thanks for the quick reply evo-2 : it's run! I've tried this before but not
with the ul balise maybe why it doesn't work?

Good day !


evo-2 wrote:
 
 
 $(ul li a).each(function(){
  $(this).addClass(tooptip2);
 });
 
 Aysseline wrote:
 Hi

 I've got a  list of image with links and need to add a class on the fly
 on
 the ahref link. The output is like that
 ul
 li http://www.site.com/  http://www.imageurl.com/img.png  /li
 li http://www.site.com/  http://www.imageurl.com/img.png  /li
 li http://www.site.com/  http://www.imageurl.com/img.png  /li/ul

 and I want this (class=tooltip2) :
 ul
 li http://www.site.com/  http://www.imageurl.com/img.png  /li
 li http://www.site.com/  http://www.imageurl.com/img.png  /li
 li http://www.site.com/  http://www.imageurl.com/img.png  /li/ul

 I need to do this because all is auto-generated I can only add this class
 with jQuery. I tried different code but my knowledge isn't sufficient

 jQuery(.gallery li a[href^='url']).addClass(tooltip); or
 jQuery(.gallery li a).each(function() {
 jQuery(this).attr(href).addClass(tooltip); });

 and many other tricks doesn't work. I need help to achieve this, thanks
   
 
 

-- 
View this message in context: 
http://www.nabble.com/addClass-on-ahref-link-on-the-fly-tp22946637s27240p22947135.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: addClass on ahref link on the fly

2009-04-08 Thread Joseph Le Brech

where your anchor tag?
 
 Date: Wed, 8 Apr 2009 02:59:08 -0700
 From: ayssel...@gmail.com
 To: jquery-en@googlegroups.com
 Subject: [jQuery] Re: addClass on ahref link on the fly
 
 
 
 Thanks for the quick reply evo-2 : it's run! I've tried this before but not
 with the ul balise maybe why it doesn't work?
 
 Good day !
 
 
 evo-2 wrote:
  
  
  $(ul li a).each(function(){
  $(this).addClass(tooptip2);
  });
  
  Aysseline wrote:
  Hi
 
  I've got a list of image with links and need to add a class on the fly
  on
  the ahref link. The output is like that
  ul
  li http://www.site.com/ http://www.imageurl.com/img.png /li
  li http://www.site.com/ http://www.imageurl.com/img.png /li
  li http://www.site.com/ http://www.imageurl.com/img.png /li/ul
 
  and I want this (class=tooltip2) :
  ul
  li http://www.site.com/ http://www.imageurl.com/img.png /li
  li http://www.site.com/ http://www.imageurl.com/img.png /li
  li http://www.site.com/ http://www.imageurl.com/img.png /li/ul
 
  I need to do this because all is auto-generated I can only add this class
  with jQuery. I tried different code but my knowledge isn't sufficient
 
  jQuery(.gallery li a[href^='url']).addClass(tooltip); or
  jQuery(.gallery li a).each(function() {
  jQuery(this).attr(href).addClass(tooltip); });
 
  and many other tricks doesn't work. I need help to achieve this, thanks
  
  
  
 
 -- 
 View this message in context: 
 http://www.nabble.com/addClass-on-ahref-link-on-the-fly-tp22946637s27240p22947135.html
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.
 

_
Share your photos with Windows Live Photos – Free.
http://clk.atdmt.com/UKM/go/134665338/direct/01/

[jQuery] Re: adding columns to table row

2009-04-08 Thread ryan.j

to add a new column append a TD to each TR (or change the colspan of a
TD in each row you didn't modify).

you were doing this

trtd id=coltd id=col/td/td/tr

when you probably want to be doing something like...

tr id=row_1td id=col/tdtd id=col/td/tr

$('tr#row_1').append('td id=colsecond/td');

On Apr 8, 5:33 am, skunkwerk skunkw...@gmail.com wrote:
 Hi,
    i'm trying to make a really basic 'tab bar' for a project.  i
 looked at the stuff out there (ui tabs, and flytabs) but wanted
 something simpler.  i basically need to create a bunch of horizontal
 cells that can be added to, and don't need any div-switching or
 anything for the content (just links).

 i decided a single table with a row would work, and tried to figure
 out how to add new columns/cells to the table.  i tried:

 script
 function create_table()
 {
         $('#test').append('table border=\'1\'trtd id=\'col\'test/td/
 tr/table');}

 function add()
 {
         $('#col').append('tdsecond/td');}

 /script

 
 div id=test/div

 it seems to sort-of work: the table is added on-the-fly correctly, but
 when i try to add a column, it adds it to the same cell, or so it
 seems.  and the 'col' append is going to break... what's the best way
 to add a new column to the table?

 thanks!


[jQuery] Re: adding columns to table row

2009-04-08 Thread ryan.j

to add a new column append a TD to each TR (or change the colspan of a
TD in each row you didn't modify).

you were doing this

trtd id=coltd/td/td/tr

when you probably want to be doing something like...

tr id=row_1td class=col/tdtd class=col/td/tr

$('tr#row_1').append('td class=colsecond/td');

On Apr 8, 5:33 am, skunkwerk skunkw...@gmail.com wrote:
 Hi,
    i'm trying to make a really basic 'tab bar' for a project.  i
 looked at the stuff out there (ui tabs, and flytabs) but wanted
 something simpler.  i basically need to create a bunch of horizontal
 cells that can be added to, and don't need any div-switching or
 anything for the content (just links).

 i decided a single table with a row would work, and tried to figure
 out how to add new columns/cells to the table.  i tried:

 script
 function create_table()
 {
         $('#test').append('table border=\'1\'trtd id=\'col\'test/td/
 tr/table');}

 function add()
 {
         $('#col').append('tdsecond/td');}

 /script

 
 div id=test/div

 it seems to sort-of work: the table is added on-the-fly correctly, but
 when i try to add a column, it adds it to the same cell, or so it
 seems.  and the 'col' append is going to break... what's the best way
 to add a new column to the table?

 thanks!


[jQuery] Re: adding columns to table row

2009-04-08 Thread ryan.j

to add a new column append a TD to each TR (or change the colspan of a
TD in each row you didn't modify).

you were doing this

trtd id=colfirsttdsecond/td/td/tr

when you probably want to be doing something like...

tr id=row_1tdfirst/tdtdsecond/td/tr

$('tr#row_1').append('tdsecond/td');


[jQuery] Re: adding columns to table row

2009-04-08 Thread ryan.j

by the way - tables are for laying out tabular data, an unordered list
with a list-style-type:none; is a much better bet for horizontal
navigation.

it'll work in basically the same way

ul id=nav
  lifirst/li
  lisecond/li
  lithird/li
  lietc./li
/ul

On Apr 8, 11:29 am, ryan.j ryan.joyce...@googlemail.com wrote:
 to add a new column append a TD to each TR (or change the colspan of a
 TD in each row you didn't modify).

 you were doing this

 trtd id=colfirsttdsecond/td/td/tr

 when you probably want to be doing something like...

 tr id=row_1tdfirst/tdtdsecond/td/tr

 $('tr#row_1').append('tdsecond/td');


[jQuery] Re: Jquery makes two ajax requests in one!!

2009-04-08 Thread donb

I would breakpoint 'deeper', down in the ajax code such as where
ajaxStart is called.  Then check the stack to see how you got there.

On Apr 8, 4:53 am, Skyblaze marcomenozz...@gmail.com wrote:
 I already tried to debug with firebug and i saw that the callback
 (with the ajax request code in it) in the event handler function is
 just called once. Then i also putted an alert in the event handler and
 as i said before i see in output only one alert box so the event
 handler callback is just called once. I don't change anything in the
 origjnal selectbox

 On Apr 8, 10:49 am, Joseph Le Brech jlebr...@hotmail.com wrote:

  Can you put a breakpoint to see if it runs change twice?

  Do you change the value and the text or something similar?

   Date: Wed, 8 Apr 2009 00:49:45 -0700
   Subject: [jQuery] Re: Jquery makes two ajax requests in one!!
   From: marcomenozz...@gmail.com
   To: jquery-en@googlegroups.com

   this is very very strange...any ideas?

   On Apr 8, 1:52áam, Skyblaze marcomenozz...@gmail.com wrote:
ok i did that and i have only one alert box so the event is fired
once. So what is that fires two same ajax get request?

On Apr 8, 1:00áam, James james.gp@gmail.com wrote:

 Try adding an alert or console.log in your change event (not inside
 your ajax success callback) to debug whether the change event is
 actually being called once or twice.

 On Apr 7, 12:23ápm, Skyblaze marcomenozz...@gmail.com wrote:

  I have no other id with that name and also with firebug suspended it
  is the same.always the same ajax/get request...two identical 
  ajax
  get request one after the other

  On Apr 7, 8:31ápm, Rick Faircloth r...@whitestonemedia.com 
  wrote:

   Make sure you don't have another id called #comprensori_id.
   I had some code left over from experimentation on a page that
   I failed to clear off and every time a certain ajax function ran,
   it did so twice!

   Rick

   -Original Message-
   From: jquery-en@googlegroups.com 
   [mailto:jquery...@googlegroups.com] On

   Behalf Of Skyblaze
   Sent: Tuesday, April 07, 2009 12:31 PM
   To: jQuery (English)
   Subject: [jQuery] Jquery makes two ajax requests in one!!

   I have a strange problem. I have to do an ajax request after a 
   select
   box changes (change event) so i have the following code:

   $('#comprensori_id').change(function() {
   á á á á á á á á á á á á var comprensorio_id = $(this).val();
   á á á á á á á á á á á á $.ajax({
   á á á á á á á á á á á á á á á á á átype: GET,
   á á á á á á á á á á á á á á á á á áurl: ,
   á á á á á á á á á á á á á á á á á ádata: comprensorio_id= +
   comprensorio_id,
   á á á á á á á á á á á á á á á á á ásuccess: function(data, msg){
   á á á á á á á á á á á á á á á á $('#comuni_id').empty();
   á á á á á á á á á á á á á á á á $('#comuni_id').append(data);
   á á á á á á á á á á á á á á á á á á}
   á á á á á á á á á á á á á á á á á});
   á á á á á á á á });

   the problem is that when i change the select box selection my 
   browser
   makes two consecutives same ajax request and i can't figure out
   why...this is very strange

  _
  View your Twitter and Flickr updates from one place – Learn 
  more!http://clk.atdmt.com/UKM/go/137984870/direct/01/


[jQuery] Re: Jquery makes two ajax requests in one!!

2009-04-08 Thread Skyblaze

whre i have to put this breakpoint in firebug?

On Apr 8, 12:45 pm, donb falconwatc...@comcast.net wrote:
 I would breakpoint 'deeper', down in the ajax code such as where
 ajaxStart is called.  Then check the stack to see how you got there.

 On Apr 8, 4:53 am, Skyblaze marcomenozz...@gmail.com wrote:

  I already tried to debug with firebug and i saw that the callback
  (with the ajax request code in it) in the event handler function is
  just called once. Then i also putted an alert in the event handler and
  as i said before i see in output only one alert box so the event
  handler callback is just called once. I don't change anything in the
  origjnal selectbox

  On Apr 8, 10:49 am, Joseph Le Brech jlebr...@hotmail.com wrote:

   Can you put a breakpoint to see if it runs change twice?

   Do you change the value and the text or something similar?

Date: Wed, 8 Apr 2009 00:49:45 -0700
Subject: [jQuery] Re: Jquery makes two ajax requests in one!!
From: marcomenozz...@gmail.com
To: jquery-en@googlegroups.com

this is very very strange...any ideas?

On Apr 8, 1:52áam, Skyblaze marcomenozz...@gmail.com wrote:
 ok i did that and i have only one alert box so the event is fired
 once. So what is that fires two same ajax get request?

 On Apr 8, 1:00áam, James james.gp@gmail.com wrote:

  Try adding an alert or console.log in your change event (not inside
  your ajax success callback) to debug whether the change event is
  actually being called once or twice.

  On Apr 7, 12:23ápm, Skyblaze marcomenozz...@gmail.com wrote:

   I have no other id with that name and also with firebug suspended 
   it
   is the same.always the same ajax/get request...two identical 
   ajax
   get request one after the other

   On Apr 7, 8:31ápm, Rick Faircloth r...@whitestonemedia.com 
   wrote:

Make sure you don't have another id called #comprensori_id.
I had some code left over from experimentation on a page that
I failed to clear off and every time a certain ajax function 
ran,
it did so twice!

Rick

-Original Message-
From: jquery-en@googlegroups.com 
[mailto:jquery...@googlegroups.com] On

Behalf Of Skyblaze
Sent: Tuesday, April 07, 2009 12:31 PM
To: jQuery (English)
Subject: [jQuery] Jquery makes two ajax requests in one!!

I have a strange problem. I have to do an ajax request after a 
select
box changes (change event) so i have the following code:

$('#comprensori_id').change(function() {
á á á á á á á á á á á á var comprensorio_id = $(this).val();
á á á á á á á á á á á á $.ajax({
á á á á á á á á á á á á á á á á á átype: GET,
á á á á á á á á á á á á á á á á á áurl: ,
á á á á á á á á á á á á á á á á á ádata: comprensorio_id= +
comprensorio_id,
á á á á á á á á á á á á á á á á á ásuccess: function(data, msg){
á á á á á á á á á á á á á á á á $('#comuni_id').empty();
á á á á á á á á á á á á á á á á $('#comuni_id').append(data);
á á á á á á á á á á á á á á á á á á}
á á á á á á á á á á á á á á á á á});
á á á á á á á á });

the problem is that when i change the select box selection my 
browser
makes two consecutives same ajax request and i can't figure out
why...this is very strange

   _
   View your Twitter and Flickr updates from one place – Learn 
   more!http://clk.atdmt.com/UKM/go/137984870/direct/01/


[jQuery] Re: Learning about functions and methods (I am confused)

2009-04-08 Thread Geuintoo

Perfect, thanks!


[jQuery] Re: UI Tabs and Events

2009-04-08 Thread Giovanni Battista Lenoci


Haret ha scritto:

function toggleCommentForm(postid){
  // Function content
}
  


if I understood:

$('#elem').live(function() {
 // don't know what postid is, but maybe you can retreive it here:
 this.id; // id of the clicked element:
 $(this).parent().attr('id'); // id of the parent element
 toggleCommentForm(postid);
});

Bye :-)

--
gianiaz.net - web solutions
via piedo, 58 - 23020 tresivio (so) - italy
+39 347 7196482 



[jQuery] Re: addClass on ahref link on the fly

2009-04-08 Thread Aysseline


I don't have anchor, only   tag. See my first post: I put the code. But
thanks Evo-2 give me the solution.

jlebrech wrote:
 
 
 where your anchor tag?
  
 Date: Wed, 8 Apr 2009 02:59:08 -0700
 From: ayssel...@gmail.com
 To: jquery-en@googlegroups.com
 Subject: [jQuery] Re: addClass on ahref link on the fly
 
 
 
 Thanks for the quick reply evo-2 : it's run! I've tried this before but
 not
 with the ul balise maybe why it doesn't work?
 
 Good day !
 
 
 evo-2 wrote:
  
  
  $(ul li a).each(function(){
  $(this).addClass(tooptip2);
  });
  
  Aysseline wrote:
  Hi
 
  I've got a list of image with links and need to add a class on the fly
  on
  the ahref link. The output is like that
  ul
  li http://www.site.com/ http://www.imageurl.com/img.png /li
  li http://www.site.com/ http://www.imageurl.com/img.png /li
  li http://www.site.com/ http://www.imageurl.com/img.png /li/ul
 
  and I want this (class=tooltip2) :
  ul
  li http://www.site.com/ http://www.imageurl.com/img.png /li
  li http://www.site.com/ http://www.imageurl.com/img.png /li
  li http://www.site.com/ http://www.imageurl.com/img.png /li/ul
 
  I need to do this because all is auto-generated I can only add this
 class
  with jQuery. I tried different code but my knowledge isn't sufficient
 
  jQuery(.gallery li a[href^='url']).addClass(tooltip); or
  jQuery(.gallery li a).each(function() {
  jQuery(this).attr(href).addClass(tooltip); });
 
  and many other tricks doesn't work. I need help to achieve this,
 thanks
  
  
  
 
 -- 
 View this message in context:
 http://www.nabble.com/addClass-on-ahref-link-on-the-fly-tp22946637s27240p22947135.html
 Sent from the jQuery General Discussion mailing list archive at
 Nabble.com.
 
 
 _
 Share your photos with Windows Live Photos – Free.
 http://clk.atdmt.com/UKM/go/134665338/direct/01/
 

-- 
View this message in context: 
http://www.nabble.com/addClass-on-ahref-link-on-the-fly-tp22946637s27240p22948529.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: Using Thickbox 3 to play a Flash Intro?...

2009-04-08 Thread ryan.j

Probably. Taking a look at the thickbox .JS you've got the line...

function tb_show(caption, url, imageGroup) {//function called when the
user clicks on a thickbox link

so on the .ready event you could try...

var c = this is your caption text;
var u = this is your url;
tb_show(c,u,'');

i've never used thickbox mind, so you might have to have a play with
that.

On Apr 8, 6:57 am, Ruester ruesterp...@sbcglobal.net wrote:
 Does anyone know if I can have the Thickbox Plugin Pop up when someone
 navigates to the page and play a small Flash intro


[jQuery] Re: Using Thickbox 3 to play a Flash Intro?...

2009-04-08 Thread ryan.j

The FAQ on the site says it will display flash.

http://jquery.com/demo/thickbox/#qa

Not sure if that means loading it as an image, by URL, or simply
loading a page with the flash already embedded though.

On Apr 8, 12:40 pm, ryan.j ryan.joyce...@googlemail.com wrote:
 Probably. Taking a look at the thickbox .JS you've got the line...

 function tb_show(caption, url, imageGroup) {//function called when the
 user clicks on a thickbox link

 so on the .ready event you could try...

 var c = this is your caption text;
 var u = this is your url;
 tb_show(c,u,'');

 i've never used thickbox mind, so you might have to have a play with
 that.

 On Apr 8, 6:57 am, Ruester ruesterp...@sbcglobal.net wrote:

  Does anyone know if I can have the Thickbox Plugin Pop up when someone
  navigates to the page and play a small Flash intro


[jQuery] Re: Learning about functions and methods (I am confused)

2009-04-08 Thread Jordon Bedwell

http://docs.jquery.com/Plugins/Authoring gives a brief explanation of which
is better in which situation, either situation is alright to use, no one is
better than the other for the average programmer, but there are situations
that call for the two types.

-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of RobG
Sent: Wednesday, April 08, 2009 5:36 AM
To: jQuery (English)
Subject: [jQuery] Re: Learning about functions and methods (I am confused)




On Apr 8, 6:49 pm, Jordon Bedwell jor...@envygeeks.com wrote:
 Try:

 $.extend({
         myPlugin:{
                 myExtend:function() {
                         alert('This');
                 }
         }});

Can you say why that is better than:

$.myPlugin.myExtend = function(){ ... }


--
Rob



[jQuery] Re: Learning about functions and methods (I am confused)

2009-04-08 Thread RobG



On Apr 8, 6:49 pm, Jordon Bedwell jor...@envygeeks.com wrote:
 Try:

 $.extend({
         myPlugin:{
                 myExtend:function() {
                         alert('This');
                 }
         }});

Can you say why that is better than:

$.myPlugin.myExtend = function(){ ... }


--
Rob


[jQuery] Re: live() not working in IE8?

2009-04-08 Thread Jordon Bedwell

Switch on compatbility mode and see if it fixes the problem.  Although it is
usually made for 'layouts' it has been known to work on some older examples
of code. As well, test it on IE 8 Vista which is not in beta anymore.  As
with, IE 8 Windows 7 technically isn't beta anymore since it was recently
reported that Windows 7 went RC this week.  Either way, test it in Vista
(you can obtain an IE 7 Vista IMG for VM from Microsoft for free and just
put IE 8 on there) and let us know if the problem exists there, it could be
a bug in the IE 8 Windows 7 release that needs to be reported before the RC
is an official build.

-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of Dayjo
Sent: Wednesday, April 08, 2009 2:32 AM
To: jQuery (English)
Subject: [jQuery] Re: live() not working in IE8?


However I have recently been noticing IE 8 Beta having issues with the
live('click') event... could be the fact I'm using Windows 7 IE 8
beta... but who knows!

On Apr 8, 9:30 am, Dayjo dayjoas...@gmail.com wrote:
 The solution I made for this problem is to put the .change() function
 inside a function called DOMReload() along side other similar
 functions, then.. whenever I do any ajax calls or loads() I run
 DOMReload() so that the function is re-applied to all new elements.

 It's a shame that live doesn't work with these events, and its a shame
 that jquery doesnt have a $(dom.reload)  function instead of or as
 well as $(document.ready).

 On Mar 12, 1:27 am, Dave Methvin dave.meth...@gmail.com wrote:

   $('#orderlineform #product_id').live('change',isRentalActive);

  The change event isn't one of the ones supported by .live(), in fact
  it's specifically documented as not supported:

 http://docs.jquery.com/Events/live#typefn

  The .live() method requires events to bubble to the document level
  where they're handled. The reason your code works fine in Firefox and
  others is because they do the right thing and bubble the change event
  as specified by the W3C. IE, on the other hand...do we really need to
  finish this sentence?  :-)



[jQuery] Re: Jquery makes two ajax requests in one!!

2009-04-08 Thread Joseph Le Brech

 $.ajax(

 //here then look in the dom inspector, you may see and array with two elements 
instead of just one

{
 
 Date: Wed, 8 Apr 2009 03:54:16 -0700
 Subject: [jQuery] Re: Jquery makes two ajax requests in one!!
 From: marcomenozz...@gmail.com
 To: jquery-en@googlegroups.com
 
 
 whre i have to put this breakpoint in firebug?
 
 On Apr 8, 12:45 pm, donb falconwatc...@comcast.net wrote:
  I would breakpoint 'deeper', down in the ajax code such as where
  ajaxStart is called.  Then check the stack to see how you got there.
 
  On Apr 8, 4:53 am, Skyblaze marcomenozz...@gmail.com wrote:
 
   I already tried to debug with firebug and i saw that the callback
   (with the ajax request code in it) in the event handler function is
   just called once. Then i also putted an alert in the event handler and
   as i said before i see in output only one alert box so the event
   handler callback is just called once. I don't change anything in the
   origjnal selectbox
 
   On Apr 8, 10:49 am, Joseph Le Brech jlebr...@hotmail.com wrote:
 
Can you put a breakpoint to see if it runs change twice?
 
Do you change the value and the text or something similar?
 
 Date: Wed, 8 Apr 2009 00:49:45 -0700
 Subject: [jQuery] Re: Jquery makes two ajax requests in one!!
 From: marcomenozz...@gmail.com
 To: jquery-en@googlegroups.com
 
 this is very very strange...any ideas?
 
 On Apr 8, 1:52áam, Skyblaze marcomenozz...@gmail.com wrote:
  ok i did that and i have only one alert box so the event is fired
  once. So what is that fires two same ajax get request?
 
  On Apr 8, 1:00áam, James james.gp@gmail.com wrote:
 
   Try adding an alert or console.log in your change event (not 
   inside
   your ajax success callback) to debug whether the change event is
   actually being called once or twice.
 
   On Apr 7, 12:23ápm, Skyblaze marcomenozz...@gmail.com wrote:
 
I have no other id with that name and also with firebug 
suspended it
is the same.always the same ajax/get request...two 
identical ajax
get request one after the other
 
On Apr 7, 8:31ápm, Rick Faircloth r...@whitestonemedia.com 
wrote:
 
 Make sure you don't have another id called #comprensori_id.
 I had some code left over from experimentation on a page that
 I failed to clear off and every time a certain ajax function 
 ran,
 it did so twice!
 
 Rick
 
 -Original Message-
 From: jquery-en@googlegroups.com 
 [mailto:jquery...@googlegroups.com] On
 
 Behalf Of Skyblaze
 Sent: Tuesday, April 07, 2009 12:31 PM
 To: jQuery (English)
 Subject: [jQuery] Jquery makes two ajax requests in one!!
 
 I have a strange problem. I have to do an ajax request after 
 a select
 box changes (change event) so i have the following code:
 
 $('#comprensori_id').change(function() {
 á á á á á á á á á á á á var comprensorio_id = $(this).val();
 á á á á á á á á á á á á $.ajax({
 á á á á á á á á á á á á á á á á á átype: GET,
 á á á á á á á á á á á á á á á á á áurl: ,
 á á á á á á á á á á á á á á á á á ádata: comprensorio_id= +
 comprensorio_id,
 á á á á á á á á á á á á á á á á á ásuccess: function(data, 
 msg){
 á á á á á á á á á á á á á á á á $('#comuni_id').empty();
 á á á á á á á á á á á á á á á á $('#comuni_id').append(data);
 á á á á á á á á á á á á á á á á á á}
 á á á á á á á á á á á á á á á á á});
 á á á á á á á á });
 
 the problem is that when i change the select box selection my 
 browser
 makes two consecutives same ajax request and i can't figure 
 out
 why...this is very strange
 
_
View your Twitter and Flickr updates from one place – Learn 
more!http://clk.atdmt.com/UKM/go/137984870/direct/01/

_
Beyond Hotmail — see what else you can do with Windows Live.
http://clk.atdmt.com/UKM/go/134665375/direct/01/

[jQuery] Re: Circular jCarousel

2009-04-08 Thread Filipe La Ruina

Surely i control the html, after it was generated. But that isn't the
point, since it didn't work well, even doing like the example (putting
the html in a array).

Although, today i'll try to use our friend Nathan plug-in.

On Apr 7, 10:03 pm, MorningZ morni...@gmail.com wrote:
 Well, i can't because the html is being generated by PHP

 Do you control the outputted HTML by PHP?

 On Apr 7, 7:36 pm, Filipe La Ruina filaru...@gmail.com wrote:

  Yeah, i know it doesn't, but jCarouselite for example does it in a
  nice way (although other problems showed up when i tryed to use it)

  I'll try to see your plug-in, thanks for your help.

  On Apr 7, 6:57 pm, Nathan nsear...@gmail.com wrote:

   jCarousel doesn't really do looping. Most content sliders don't
   because of the fundamentals behind how they are generated on the page.

   I have just released a plugin called loopedSlider that loops slider
   content. It may be a solution for you. If so let me know.

  http://code.google.com/p/loopedslider/

   On Apr 6, 3:05 pm, Filipe La Ruina filaru...@gmail.com wrote:

Hello everyone!
I'm trying to use jCarousel in a project and the client asks for the
following:
4 pages circular slideshow showing two articles at a time, scrolling
one by one. All that with page controls and next/previous buttons as
well as an play/pause button.

Well, I managed to do all the controls needed but couldn't make it
circular. All my data will load with the page, so i'm setting the list
itens in the html already (all that to say, no ajax involved). I'd
like to know if someone managed to make static data circular, since in
the website (http://sorgalla.com/projects/jcarousel/#Examples) there
is a circular example that shows only data beeing 'generated' in
execution time. Well, i can't do that with my data, so i'm asking for
some help.

Also, I would appreciate if someone could explain me what the 'wrap:
circular' option does, since i see no difference in using it.

I thank you all for the help,

Filipe La Ruina


[jQuery] [tooltip] Way to make the tooltip plugin accessible to browsers with no mouseover?

2009-04-08 Thread Emmett

The tooltip plugin is slick, but there's one vital thing it appears to
be missing: the ability to click instead of hovering.

Why do I want that? Some browsers, like the iPhone, don't have the
mouseover event at all. The tooltips are completely unavailable to
those browsers.

Is there a hack to support this?


[jQuery] jQuery UI Autocomplete - Removing items / detecting all values from multiselect

2009-04-08 Thread Rob

Hello,

Is there a way to always know what values are selected inside of a
jquery ui autocomplete widget? I know there is a result event that
fires when you select a value, but what about when you remove a value?

Thanks,
Rob


[jQuery] jQuery appendTo() in IE7 before ready() [qTip|BlockUI]

2009-04-08 Thread Thomas Creutz
Hi..

I have strange problems with IE7 (older/newer version not tested, but I think, 
it is also 
present in IE6) and some plugins, that do a appendTo().


The Webpage stops loading and I get a warning which says:

Die Internetsite http://mypage.de/ kann nicht geöffnet werden.
Vorgang abgebrochen

Translated something like:
The Website http://mypage.de/ cannot be opened.
process canceled

And than I get not my Webpage displayed.. no I get a IE intern website, which 
tells me, 
that the page cannot be displayed.

So I made some checks, and see, that this bug occurs when the appendTo() 
command is 
executed. So I made a attempt and made a function which made all the stuff 
which I do 
normal at load and assign them to the $(document).ready() event - so the error 
message is 
gone.

Does somebody now more about it? Can we make a jQuery.support.appendtoBug.

My output html displays rooms in boxes and every box have button, but the 
bottons are 
driven from a javascript which polls every second the status for this room. 
Dependent on 
the room-status react this button. So I write a code like this:

a id=button_rid_{roomrow.ROOM_ID}
class=button_4_{$B_COLOR}
href=roomAction({roomrow.ROOM_ID}){roomrow.ROOM_BUTTON_TEXT}/a
script type=text/javascript
// ![CDATA[
  addRoom({id: {roomrow.ROOM_ID}, bclass: 4})
// ]]
/script

in the addRoom function, I want to block the the button until the vars are 
loaded over 
AJAX, which works fine with the BlockUI plugin 
(http://www.malsup.com/jquery/block/) on 
Firefox. So the user see, that this room is current loading and the input is 
blocked.

In IE I get the described bug... and the ready() solutions is not exactly what 
I wont..

Also the qTip Plugin (http://craigsworks.com/projects/qtip/), which I append in 
addRoom to 
the Button trips in this bug.


The final question is, who should fix this? the plugin author? Or is there any 
other solution?

regards,
Thomas



signature.asc
Description: OpenPGP digital signature


[jQuery] [validate]

2009-04-08 Thread jamesT77

Im using asp.net and we use linkbuttons to submit our forms.
The linkbuttons get rendered as hyperlinks with a javascript function
firing a postback.

is there anyway i can get the validation plugin to fire on click of
the hyperlink and then fire the postback if valid.


[jQuery] Re: Call for contributors: A simple, fast and flexible grid/spreadsheet component.

2009-04-08 Thread lawrence.pit


Just wanted to give a big shoutout to slickgrid (http://
slickgrid.googlecode.com).

I think Michael has nailed it. Totally. This is how a grid widget for
jquery ui should be. The code looks super clean too. And promotes an
MVC approach.

The rendering technique employed is simply awesome.

Michael, I wouldn't add the ajax-loading stuff. That should not be
part of the grid (that's what other grids always do, see where they
end up... ;)


Cheers,
Lawrence


[jQuery] Find if a checkbox is ticked or not by user

2009-04-08 Thread Eric

Hi,

I am having a simple issue but can't get it work. I've searched other
similar posts but still no good luck.

I've got a checkbox on my form not checked by default and it's up to
the user to select it.

input id=chk01 name=chk01 type=checkbox

I then want to detect if user has selected it or not in jQuery
(triggered by some event)

I've tried to use $(#chk01).attr(checked) which always gives me
undefined value no matter if it is checked or not.

Also tried $(#chk01).is(':checked') which always gives me 'false' no
matter if it is checked or not.

I did this in FFox with FireBug. I also noticed that as user check/
uncheck the box, the underlying html is not updated (always remains
initial value), which is probably why the attr function is unable to
pick up the value.

Can anyone help?

Thanks,

Eric



[jQuery] [autocomplete] how to handle special characters?

2009-04-08 Thread Markos Gogoulos

Hi there,

while using autocomplete, I've noticed that characters  and ' get
escaped as amp; and #39;

Example, autocomplete displays Barbara’s Straight Son but when I
choose this the field shows Barbara#39;s Straight Son


Any ideas how I can avoid this?

Thank you for your time!



[jQuery] How to get the number of the selected element?

2009-04-08 Thread jgmach

Hi there,

I got 10 links on a site, all with the class collapsible.

like this:

a
a
a
a
a - user clicks this
a
a
a
a
a

Now I want some var that stores the number 5 in this case.

Hope you can help me.


[jQuery] Superfish stacked sub menus

2009-04-08 Thread katalysis

Has anyone any thoughts on how to modify Superfish so that submenus
show in a stack rather than to the right of the parent menu?

Example: http://www.katalysis.net/assets/images/stacked-superfish.png


[jQuery] Problem Containts for select words

2009-04-08 Thread Jean Carlo


I am using the function to search for words in containts TR.
I have three words well (Sunday and Monday, Sunday and Monday and
Sunday)
Only is selected and the second Saturday and Sunday and Monday.
I was also selected to Sunday but could not.
Thanks to All

Im using$('table#horario tbody tr td:nth-child(' + n + '):contains('
+ textoCelula + ')').parents('tr').addClass('destacar');


Containts handle the months


[jQuery] problem with IE extracting the document title from an ajax request response

2009-04-08 Thread Zac Spitzer

Is there a trick with IE for extracting the title from
an ajax response?

This works fine in FF but fails in IE using 1.3.2
var newTitle=$(response).filter(TITLE);

it's a horrible problem to google as title is sooo common

z


[jQuery] Re: addClass on ahref link on the fly

2009-04-08 Thread Liam Potter


$(ul li a).each(function(){
$(this).addClass(tooptip2);
});

Aysseline wrote:

Hi

I've got a  list of image with links and need to add a class on the fly on
the ahref link. The output is like that
ul
li http://www.site.com/  http://www.imageurl.com/img.png  /li
li http://www.site.com/  http://www.imageurl.com/img.png  /li
li http://www.site.com/  http://www.imageurl.com/img.png  /li/ul

and I want this (class=tooltip2) :
ul
li http://www.site.com/  http://www.imageurl.com/img.png  /li
li http://www.site.com/  http://www.imageurl.com/img.png  /li
li http://www.site.com/  http://www.imageurl.com/img.png  /li/ul

I need to do this because all is auto-generated I can only add this class
with jQuery. I tried different code but my knowledge isn't sufficient

jQuery(.gallery li a[href^='url']).addClass(tooltip); or
jQuery(.gallery li a).each(function() {
jQuery(this).attr(href).addClass(tooltip); });

and many other tricks doesn't work. I need help to achieve this, thanks
  


[jQuery] Re: Jquery makes two ajax requests in one!!

2009-04-08 Thread Joseph Le Brech

Can you put a breakpoint to see if it runs change twice?

 

Do you change the value and the text or something similar?
 
 Date: Wed, 8 Apr 2009 00:49:45 -0700
 Subject: [jQuery] Re: Jquery makes two ajax requests in one!!
 From: marcomenozz...@gmail.com
 To: jquery-en@googlegroups.com
 
 
 this is very very strange...any ideas?
 
 On Apr 8, 1:52áam, Skyblaze marcomenozz...@gmail.com wrote:
  ok i did that and i have only one alert box so the event is fired
  once. So what is that fires two same ajax get request?
 
  On Apr 8, 1:00áam, James james.gp@gmail.com wrote:
 
   Try adding an alert or console.log in your change event (not inside
   your ajax success callback) to debug whether the change event is
   actually being called once or twice.
 
   On Apr 7, 12:23ápm, Skyblaze marcomenozz...@gmail.com wrote:
 
I have no other id with that name and also with firebug suspended it
is the same.always the same ajax/get request...two identical ajax
get request one after the other
 
On Apr 7, 8:31ápm, Rick Faircloth r...@whitestonemedia.com wrote:
 
 Make sure you don't have another id called #comprensori_id.
 I had some code left over from experimentation on a page that
 I failed to clear off and every time a certain ajax function ran,
 it did so twice!
 
 Rick
 
 -Original Message-
 From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] 
 On
 
 Behalf Of Skyblaze
 Sent: Tuesday, April 07, 2009 12:31 PM
 To: jQuery (English)
 Subject: [jQuery] Jquery makes two ajax requests in one!!
 
 I have a strange problem. I have to do an ajax request after a select
 box changes (change event) so i have the following code:
 
 $('#comprensori_id').change(function() {
 á á á á á á á á á á á á var comprensorio_id = $(this).val();
 á á á á á á á á á á á á $.ajax({
 á á á á á á á á á á á á á á á á á átype: GET,
 á á á á á á á á á á á á á á á á á áurl: ,
 á á á á á á á á á á á á á á á á á ádata: comprensorio_id= +
 comprensorio_id,
 á á á á á á á á á á á á á á á á á ásuccess: function(data, msg){
 á á á á á á á á á á á á á á á á $('#comuni_id').empty();
 á á á á á á á á á á á á á á á á $('#comuni_id').append(data);
 á á á á á á á á á á á á á á á á á á}
 á á á á á á á á á á á á á á á á á});
 á á á á á á á á });
 
 the problem is that when i change the select box selection my browser
 makes two consecutives same ajax request and i can't figure out
 why...this is very strange

_
View your Twitter and Flickr updates from one place – Learn more!
http://clk.atdmt.com/UKM/go/137984870/direct/01/

[jQuery] Re: [tooltip] Way to make the tooltip plugin accessible to browsers with no mouseover?

2009-04-08 Thread Jörn Zaefferer

How does the iPhone handle native tooltips?

According to quirksmode.org, the mouseover event is actually fired.
Just not quite in the usual way:
http://www.quirksmode.org/blog/archives/2008/08/iphone_events.html

Jörn

On Wed, Apr 8, 2009 at 12:55 PM, Emmett emmett.the.s...@gmail.com wrote:

 The tooltip plugin is slick, but there's one vital thing it appears to
 be missing: the ability to click instead of hovering.

 Why do I want that? Some browsers, like the iPhone, don't have the
 mouseover event at all. The tooltips are completely unavailable to
 those browsers.

 Is there a hack to support this?



[jQuery] Re: Learning about functions and methods (I am confused)

2009-04-08 Thread RobG



On Apr 8, 2:03 am, Geuintoo drummerb...@gmail.com wrote:
 Hy

 (function($){

         $.myPlugin = function(){

              holla: function(){
                 alert('holla');
             }
         }

The above will create a myPluggin property of the object referenced by
$ (which is the jQuery object).  It assigns a reference to an
anonymous function, the body of which consists of the label:

  holla:

and the anonymous function:

  function(){ alert('holla'); }

The function does not do anything -  the internal anonymous function
is never called, nor does it return any value.  It is the equivalent
of an empty function object.


         $.myPlugin.hello = function(){
           alert('hello von Plugin');
         }

The above creates a hello property of $.myPlugin and assigns a
reference to an anonymous function.  The body displays an alert with
some text.


 })(jQuery);

 // Works finde:
 $.myPlugin.hello();

Where works means displays the text hello von Plugin.


 // It does not work. Why?
 $.myPlugin.holla();

Where does not work likely means throws an error as $.myPlugin does
not have a holla property, so trying to call it is doomed to failure.


 Is there a posibility to write a method in:

 ... snip
 $.myPlugin = function(){

              // Write methode here
             }
         }
 ...snip

 So that
   $.myPlugin.holla();
 will work?

There are many ways - what you seem to have attempted was an object
literal, so:

(function($) {
$.myPlugin = {
holla: function(){
alert('holla');
},
hello: function(){
alert('hello von Plugin');
}
}
})(jQuery);


--
Rob


[jQuery] Re: Find if a checkbox is ticked or not by user

2009-04-08 Thread Joseph Le Brech

sorry in advance if this doesn't work straight off, im typing from hotmail 
directly.

 

try

 

if(len($(#chk1 :checked))0){

 

}

 

or 

 

if($(#chk1).attr(checked)==true){

 

}
 
 Date: Tue, 7 Apr 2009 23:15:29 -0700
 Subject: [jQuery] Find if a checkbox is ticked or not by user
 From: morningsunsh...@gmail.com
 To: jquery-en@googlegroups.com
 
 
 Hi,
 
 I am having a simple issue but can't get it work. I've searched other
 similar posts but still no good luck.
 
 I've got a checkbox on my form not checked by default and it's up to
 the user to select it.
 
 input id=chk01 name=chk01 type=checkbox
 
 I then want to detect if user has selected it or not in jQuery
 (triggered by some event)
 
 I've tried to use $(#chk01).attr(checked) which always gives me
 undefined value no matter if it is checked or not.
 
 Also tried $(#chk01).is(':checked') which always gives me 'false' no
 matter if it is checked or not.
 
 I did this in FFox with FireBug. I also noticed that as user check/
 uncheck the box, the underlying html is not updated (always remains
 initial value), which is probably why the attr function is unable to
 pick up the value.
 
 Can anyone help?
 
 Thanks,
 
 Eric
 

_
View your Twitter and Flickr updates from one place – Learn more!
http://clk.atdmt.com/UKM/go/137984870/direct/01/

[jQuery] Re: jQuery within Javascript?

2009-04-08 Thread Edward Ludlow


Michael Geary wrote:
 The reason your code doesn't work is that you have a single 
numBackgrounds
 variable shared throughout all the code. You may increment this in a 
loop,
 but then later on when the .click() callback is called, 
numBackgrounds has

 already been incremented all the way to 6.

 Also your loop should probably start at 1 instead of 5.

Great thanks - can't believe I screwed the loop control up, starting at 
5brain ache moment!


Thanks for all the help, got it sorted out now.

Ed



[jQuery] Re: JQuery, JqGrid, and Ajax

2009-04-08 Thread Natkeeran L.K.

Hello Tony:

Thank you for the reply.

I inserted like below.  But, it does not load the data:
http://pssnet.com/~devone/ajqtable/summary36.html.  Just empty grid.

I also tried to inserted like jQuery(#list3).trigger
(reloadGrid).jqGrid({no success.

I just need the functionality, thus any sample code that works...I'll
adopt.

Thanks again for the time.

Regards,
Nat

ondblClickRow: function(id){
var x = id;
alert(You double click row with id: +id);
jQuery(#list3).trigger(reloadGrid);
// Load Dynamic Data
jQuery(#list3).jqGrid({

datatype: function(postdata){
jQuery.ajax({
url:'get_services.php?name='+x,
data:postdata,

datatype: json,
type: 'POST',
contentType: application/json; 
charset=utf-8,
complete: function (jsondata, stat){
if(stat==success){

var thegrid = 
jQuery(#list3)[0];

thegrid.addJSONData(eval((+jsondata.responseText+)));

alert(yes);
}
else{

alert(no);
}
} // end 
complete
}); // end ajax
}, // end datatype

colNames:['Product No', 'Name', 'type'],

colModel:[

{name:'product_id',index:'product_id', 
width:75},

{name:'name',index:'name', width:100},

{name:'type',index:'type', width:100},

],

pager: jQuery('#pager3'),

rowNum:10,

rowList:[10,20,30],

imgpath: 'themes/sand/images',

sortname: 'id',

viewrecords: true,

sortorder: asc
});

},  //end ondblClickRow function

On Apr 8, 3:50 am, Tony t...@trirand.com wrote:
 Hello again,
 Sorry missed that you have datatype as function.
 The 2 should be just

 var x;
 .
 ondblClickRow: function(id){
 x =id;
 .
 jQuery(#list3).trigger(reloadGrid);
 ..

 }

 On Apr 8, 10:43 am, Tony t...@trirand.com wrote:

  Hello,
  Basically jqGrid first check if the grid exists.
  If the grid does not exists the plugin create the grid and data is
  populated.
  If the grid exists nothing is happen.
  In other words you try to call every time jqGrid on already created
  grid.
  To avoid this there are a lot of scenarious.
  1. Create a empty second grid and hide them (if you want)
  2. Then after every double click do something like this

  jQuery(#list3).setGridParam({url:'get_services.php?name='+x}).trigger
  (reloadGrid)

  Best Regards
  Tony

  On Apr 7, 10:21 pm, NatkeeranL.K. natkee...@gmail.com wrote:

   Hello:

   I am trying to develop a similar functionality as here:http://
   koshersavings.ca/SelectItems.php

   When the user to clicks an row item, I want items to be loaded based
   on the selection, dynamically.

   I am trying to do the same, but usingjqgrid, and ajax.

   The current code is here:  (also note 
   below)http://pssnet.com/~devone/ajqtable/summary35.html

   Basically, when the user double clicks it loads a corresponding
   table.  But, when they select another, it will not reloaded.  Any help
   appreciated.  Thanks.

   Regards,
   Nat

       ondblClickRow: function(id){
                   var x = id;
                   alert(You double click row with id: +id);

                           // Load Dynamic Data
                   jQuery(#list3).jqGrid({
                                   datatype: function(postdata){
                                           jQuery.ajax({
                                           url:'get_services.php?name='+x,
                                           data:postdata,

                                           datatype: json,
                                           complete: function (jsondata, 
   stat){
                                                           
   if(stat==success){
                                            

[jQuery] Re: Modal Form Validation + JSON call

2009-04-08 Thread Richard D. Worth
It's possible you're having an issue because the dialog content element is
moved to the end of the body. So if that element contains form elements,
rather than an entire form, they'll be removed from the form. For more info
(including some work-arounds) see

http://groups.google.com/group/jquery-ui-dev/browse_thread/thread/1e960b5b82d2f3a5

For any further help with the jQuery UI Dialog, note there's a separate
mailing list for jQuery UI help:

http://groups.google.com/group/jquery-ui

- Richard

On Tue, Apr 7, 2009 at 11:50 PM, wwor...@gmail.com wwor...@gmail.comwrote:

 Jorn i think you might be able to help with this as it relates to your
 validate stuff, again any help is great.

 I did find some post relating to removing the submit handler for the
 modal buttons but not sure how to get that to work, tried a few things
 and couldn't get it to work.

 On Apr 7, 11:07 pm, wwor...@gmail.com wwor...@gmail.com wrote:
  can't seem to get the button for the modal to fire off the event for
  validate can anymore see what i'm doing wrong here?
 
  $(function() {
  var name = $(#name),
  email = $(#email),
  message = $(#message),
  allFields =
 $([]).add(name).add(email).add(message),
  container = $('div.container');
 
  $(#dialog).dialog({
  bgiframe: true,
  autoOpen: false,
  resizable: false,
  height: 450,
  width: 350,
  modal: true,
  buttons: {
  'Email Resume': function() {
  $(#emailresume).validate({
  submitHandler:
 function() {
  $.ajax({
type:
 'POST',
url:
 'process.php?cmd=emailresume',
 
 dataType: 'html',
data: {
 name: $('#name').val(), email: $('#email').val(),
  message: $('#message').val() },
 
 success: function(data){
 
 $(this).dialog('close');
},
error:
 function(){
 
 alert(An error has occurred. Please try again.);
},
 
 complete: function() {
 
 $(#success).show();
 
 $(#success).fadeOut(6000);
}
  });
  return
 false;
  },
  errorContainer:
 container,
 
 errorLabelContainer: $(ul, container),
  wrapper: 'li',
  meta: validate,
  rules: {
  name: {
 
 required: true,
 
 minlength: 3,
 
 maxlength: 40
  }
  },
  messages: {
  name: {
 
 required: Name is required,
 
 minlength: jQuery.format(Name is, minimum of {0}
  characters),
 
 maxlength: jQuery.format(Name is, maximum of {0}
  characters)
  }
  }
  });
  //return false;
  },
  Cancel: function() {
  $(this).dialog('close');
  }
  },
  close: function() {
 
 allFields.val('').removeClass('ui-state-error');
  }
  });
 
  $('#emailresume').click(function() {
  $('#dialog').dialog('open');
  });
 
  });



[jQuery] Re: problem with IE extracting the document title from an ajax request response

2009-04-08 Thread Jordon Bedwell

Uhm, doesn't google disable Javascript and follow the non-javascript
version?

-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of Zac Spitzer
Sent: Wednesday, April 08, 2009 12:37 AM
To: jQuery (English)
Subject: [jQuery] problem with IE extracting the document title from an ajax
request response


Is there a trick with IE for extracting the title from
an ajax response?

This works fine in FF but fails in IE using 1.3.2
var newTitle=$(response).filter(TITLE);

it's a horrible problem to google as title is sooo common

z



[jQuery] Re: problem with IE extracting the document title from an ajax request response

2009-04-08 Thread Jonathan Vanherpe (T T NV)


I think he meant that putting 'title' in your search query is useless 
when googling, because pretty much every html document out there 
contains the word.


Jonathan

Jordon Bedwell wrote:

Uhm, doesn't google disable Javascript and follow the non-javascript
version?

-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of Zac Spitzer
Sent: Wednesday, April 08, 2009 12:37 AM
To: jQuery (English)
Subject: [jQuery] problem with IE extracting the document title from an ajax
request response


Is there a trick with IE for extracting the title from
an ajax response?

This works fine in FF but fails in IE using 1.3.2
var newTitle=$(response).filter(TITLE);

it's a horrible problem to google as title is sooo common

z





--
Jonathan Vanherpe - Tallieu  Tallieu NV - jonat...@tnt.be


[jQuery] Re: problem with IE extracting the document title from an ajax request response

2009-04-08 Thread Michael Lawson

What does your response look like?

cheers

Michael Lawson
Content Tools Developer, Global Solutions, ibm.com
Phone:  1-828-355-5544
E-mail:  mjlaw...@us.ibm.com

'Examine my teachings critically, as a gold assayer would test gold. If you
find they make sense, conform to your experience, and don't harm yourself
or others, only then should you accept them.'


   
  From:   Zac Spitzer zac.spit...@gmail.com  
   
  To: jQuery (English) jquery-en@googlegroups.com  
   
  Date:   04/08/2009 08:36 AM  
   
  Subject:[jQuery] problem with IE extracting the document title from an 
ajax request  response
   






Is there a trick with IE for extracting the title from
an ajax response?

This works fine in FF but fails in IE using 1.3.2
var newTitle=$(response).filter(TITLE);

it's a horrible problem to google as title is sooo common

z

inline: graycol.gifinline: ecblank.gif

[jQuery] Re: How to get the number of the selected element?

2009-04-08 Thread Mauricio (Maujor) Samy Silva



I got 10 links on a site, all with the class collapsible.


jQuery:
$(document).ready(function(){
$('.collapsible').click(function() {
var indexLink = $('.collapsible').index(this);
var nClicked = indexLink + 1;
alert(nClicked);
});
});
HTML
a href=# class=collapsible1/a
a href=# class=collapsible2/a
a href=# class=collapsible3/a
...
Maurício 



[jQuery] Re: JQuery, JqGrid, and Ajax

2009-04-08 Thread Tony
Hello,
Maybe you do not understand me.
The definition
jQuery(#list3).jqGrid({ ..})

should be outside of ondblClickRow.
That is:

jQuery(document).ready(function(){
//begin list2 grid
var x;
jQuery(#list2).jqGrid({
...
 ondblClickRow: function(id){
   var x = id;
alert(You double click row with id: +id);
jQuery(#list3).trigger(reloadGrid);
},
...
});
// end of list2 grid

// begin list3 grid
jQuery(#list3).jqGrid({...})
// end list3 grid

}); // end document ready


Hope this help.

On Apr 8, 4:07 pm, Natkeeran L.K. natkee...@gmail.com wrote:
 Hello Tony:

 Thank you for the reply.

 I inserted like below.  But, it does not load the 
 data:http://pssnet.com/~devone/ajqtable/summary36.html.  Just empty grid.

 I also tried to inserted like jQuery(#list3).trigger
 (reloadGrid).jqGrid({no success.

 I just need the functionality, thus any sample code that works...I'll
 adopt.

 Thanks again for the time.

 Regards,
 Nat

 ondblClickRow: function(id){
                 var x = id;
                 alert(You double click row with id: +id);
                 jQuery(#list3).trigger(reloadGrid);
                         // Load Dynamic Data
                 jQuery(#list3).jqGrid({

                                 datatype: function(postdata){
                                         jQuery.ajax({
                                         url:'get_services.php?name='+x,
                                         data:postdata,

                                         datatype: json,
                                         type: 'POST',
                                         contentType: application/json; 
 charset=utf-8,
                                         complete: function (jsondata, stat){
                                                         if(stat==success){

                                                         var thegrid = 
 jQuery(#list3)[0];
                                                         
 thegrid.addJSONData(eval((+jsondata.responseText+)));
                                                                         
 alert(yes);
                                                                         }
                                                                 else{
                                                                         
 alert(no);
                                                                         }
                                                                 } // end 
 complete
                                                 }); // end ajax
                                                 }, // end datatype

                         colNames:['Product No', 'Name', 'type'],

                         colModel:[

                                 {name:'product_id',index:'product_id', 
 width:75},

                                 {name:'name',index:'name', width:100},

                                 {name:'type',index:'type', width:100},

                                 ],

                         pager: jQuery('#pager3'),

                         rowNum:10,

                         rowList:[10,20,30],

                         imgpath: 'themes/sand/images',

                         sortname: 'id',

                         viewrecords: true,

                         sortorder: asc
                         });

                         },  //end ondblClickRow function

 On Apr 8, 3:50 am, Tony t...@trirand.com wrote:

  Hello again,
  Sorry missed that you have datatype as function.
  The 2 should be just

  var x;
  .
  ondblClickRow: function(id){
  x =id;
  .
  jQuery(#list3).trigger(reloadGrid);
  ..

  }

  On Apr 8, 10:43 am, Tony t...@trirand.com wrote:

   Hello,
   Basically jqGrid first check if the grid exists.
   If the grid does not exists the plugin create the grid and data is
   populated.
   If the grid exists nothing is happen.
   In other words you try to call every time jqGrid on already created
   grid.
   To avoid this there are a lot of scenarious.
   1. Create a empty second grid and hide them (if you want)
   2. Then after every double click do something like this

   jQuery(#list3).setGridParam({url:'get_services.php?name='+x}).trigger
   (reloadGrid)

   Best Regards
   Tony

   On Apr 7, 10:21 pm, NatkeeranL.K. natkee...@gmail.com wrote:

Hello:

I am trying to develop a similar functionality as here:http://
koshersavings.ca/SelectItems.php

When the user to clicks an row item, I want items to be loaded based
on the selection, dynamically.

I am trying to do the same, but usingjqgrid, and ajax.

The current code is here:  (also note 
below)http://pssnet.com/~devone/ajqtable/summary35.html

Basically, when the user double clicks it loads a corresponding
table.  But, when they select another, it will not reloaded.  Any help
appreciated.  Thanks.

Regards,
Nat

    ondblClickRow: function(id){
                var x = id;
                

[jQuery] Re: JQuery, JqGrid, and Ajax

2009-04-08 Thread Natkeeran L.K.

Hello Tony:

I also tried your initial suggestion, it too does not display data.

http://pssnet.com/~devone/ajqtable/summary39.html

Regards,
Nat
script type=text/javascript


jQuery(document).ready(function(){

jQuery(#list2).jqGrid({

url:'summary3.php?nd='+new Date().getTime(),

datatype: json,

colNames:['Id', 'Services'],

colModel:[

{name:'service_id',index:'service_id', width:75},

{name:'name',index:'name', width:175},

],

pager: jQuery('#pager2'),

rowNum:10,

rowList:[10,20,30],

imgpath: 'themes/sand/images',

sortname: 'id',

viewrecords: true,

sortorder: asc,



ondblClickRow: function(id){
var x = id;
alert(You double click row with id: +id);
jQuery(#list3).setGridParam({url:'get_services.php?
name='+x}).trigger(reloadGrid)
},  //end ondblClickRow function

   caption: Services


});


// Load Dynamic Data
jQuery(#list3).jqGrid({

datatype: function(postdata){
jQuery.ajax({
url:'get_services.php?name=1',
data:postdata,

datatype: json,
type: 'POST',
contentType: application/json; 
charset=utf-8,
complete: function (jsondata, stat){
if(stat==success){

var thegrid = 
jQuery(#list3)[0];

thegrid.addJSONData(eval((+jsondata.responseText+)));

alert(yes);
}
else{

alert(no);
}
} // end 
complete
}); // end ajax

jQuery(#list3).trigger(reloadGrid);
}, // end datatype

colNames:['Product No', 'Name', 'type'],

colModel:[

{name:'product_id',index:'product_id', 
width:75},

{name:'name',index:'name', width:100},

{name:'type',index:'type', width:100},

],

pager: jQuery('#pager3'),

rowNum:10,

rowList:[10,20,30],

imgpath: 'themes/sand/images',

sortname: 'id',

viewrecords: true,

sortorder: asc
});



});

/script


On Apr 8, 3:50 am, Tony t...@trirand.com wrote:
 Hello again,
 Sorry missed that you have datatype as function.
 The 2 should be just

 var x;
 .
 ondblClickRow: function(id){
 x =id;
 .
 jQuery(#list3).trigger(reloadGrid);
 ..

 }

 On Apr 8, 10:43 am, Tony t...@trirand.com wrote:

  Hello,
  Basically jqGrid first check if the grid exists.
  If the grid does not exists the plugin create the grid and data is
  populated.
  If the grid exists nothing is happen.
  In other words you try to call every time jqGrid on already created
  grid.
  To avoid this there are a lot of scenarious.
  1. Create a empty second grid and hide them (if you want)
  2. Then after every double click do something like this

  jQuery(#list3).setGridParam({url:'get_services.php?name='+x}).trigger
  (reloadGrid)

  Best Regards
  Tony

  On Apr 7, 10:21 pm, NatkeeranL.K. natkee...@gmail.com wrote:

   Hello:

   I am trying to develop a similar functionality as here:http://
   koshersavings.ca/SelectItems.php

   When the user to clicks an row item, I want items to be loaded based
   on the selection, dynamically.

   I am trying to do the same, but usingjqgrid, and ajax.

   The current code is here:  (also note 
   below)http://pssnet.com/~devone/ajqtable/summary35.html

   Basically, when the user double clicks it loads a corresponding
   table.  But, when they select another, it will not reloaded.  Any help
   appreciated.  Thanks.

   Regards,
   Nat

       ondblClickRow: function(id){
                   var x = id;
                   alert(You double click row with id: +id);

                           // Load Dynamic Data
                   jQuery(#list3).jqGrid({
                                   datatype: function(postdata){
                                      

[jQuery] Re: JQuery, JqGrid, and Ajax

2009-04-08 Thread Natkeeran L.K.

Hello Tony:

I think it is reloading the same info, and not the new info!!
http://pssnet.com/~devone/ajqtable/summary351.html

Regards,
Nat

On Apr 8, 3:50 am, Tony t...@trirand.com wrote:
 Hello again,
 Sorry missed that you have datatype as function.
 The 2 should be just

 var x;
 .
 ondblClickRow: function(id){
 x =id;
 .
 jQuery(#list3).trigger(reloadGrid);
 ..

 }

 On Apr 8, 10:43 am, Tony t...@trirand.com wrote:

  Hello,
  Basically jqGrid first check if the grid exists.
  If the grid does not exists the plugin create the grid and data is
  populated.
  If the grid exists nothing is happen.
  In other words you try to call every time jqGrid on already created
  grid.
  To avoid this there are a lot of scenarious.
  1. Create a empty second grid and hide them (if you want)
  2. Then after every double click do something like this

  jQuery(#list3).setGridParam({url:'get_services.php?name='+x}).trigger
  (reloadGrid)

  Best Regards
  Tony

  On Apr 7, 10:21 pm, NatkeeranL.K. natkee...@gmail.com wrote:

   Hello:

   I am trying to develop a similar functionality as here:http://
   koshersavings.ca/SelectItems.php

   When the user to clicks an row item, I want items to be loaded based
   on the selection, dynamically.

   I am trying to do the same, but usingjqgrid, and ajax.

   The current code is here:  (also note 
   below)http://pssnet.com/~devone/ajqtable/summary35.html

   Basically, when the user double clicks it loads a corresponding
   table.  But, when they select another, it will not reloaded.  Any help
   appreciated.  Thanks.

   Regards,
   Nat

       ondblClickRow: function(id){
                   var x = id;
                   alert(You double click row with id: +id);

                           // Load Dynamic Data
                   jQuery(#list3).jqGrid({
                                   datatype: function(postdata){
                                           jQuery.ajax({
                                           url:'get_services.php?name='+x,
                                           data:postdata,

                                           datatype: json,
                                           complete: function (jsondata, 
   stat){
                                                           
   if(stat==success){
                                                           var thegrid = 
   jQuery(#list3)[0];
                                                           
   thegrid.addJSONData(eval((+jsondata.responseText+)));
                                                                           
   alert(yes);
                                                                           }
                                                                   else{
                                                                           
   alert(no);
                                                                           }
                                                                   } // end 
   complete
                                                   }); // end ajax
                                                   }, // end datatype

                           colNames:['Product No', 'Name', 'type'],

                           colModel:[

                                   {name:'product_id',index:'product_id', 
   width:75},

                                   {name:'name',index:'name', width:100},

                                   {name:'type',index:'type', width:100},

                                   ],

                           pager: jQuery('#pager3'),

                           rowNum:10,

                           rowList:[10,20,30],

                           imgpath: 'themes/sand/images',

                           sortname: 'id',

                           viewrecords: true,

                           sortorder: asc
                           });

                           },  //end ondblClickRow function


[jQuery] Re: jQuery UI tabs: show struts action response in the current tab panel and switch to another tab

2009-04-08 Thread kpi

I found the solution for the first problem:
var $tabs = $('#tabs').tabs(
 {
 load: function(event, ui) {
$('a', ui.panel).click(function() {
$(ui.panel).load(this.href);
return false;
});

$(form[name='xxxForm']).ajaxForm(
{

target: ui.panel

}
}
}

anyone has the solution for the second problem? Thanks in advance.



On Apr 7, 1:32 pm, kpi threesta...@yahoo.com wrote:
 Hi,

 I am trying to use UI tabs for create tabs for something like this:
 Tab1:Tab2

 Here is the problems I came across:

 1. I want to show the struts action reponse in the current tab (let's
 say Tab1). However, the response is shown as a full page in the
 browser.  can someone post sample jQuery code on how to make this
 happen?

 2. If the struts action throws an exception and the struts action form
 validation fails, I want the response (error page/form validation
 errors, etc..) to be shown in the current tab panel. If the struts
 action succeeds, the second tab (Tab2) will be selected and loaded
 with contents.
   Any sample code for this?

 Thanks very much.


[jQuery] Re: Find if a checkbox is ticked or not by user

2009-04-08 Thread MorningZ

Also tried $(#chk01).is(':checked') which always gives me 'false'
no
matter if it is checked or not. 

That .is(:checked)  most definitely works, there is something else
wrong with your code/HTML



On Apr 8, 2:15 am, Eric morningsunsh...@gmail.com wrote:
 Hi,

 I am having a simple issue but can't get it work. I've searched other
 similar posts but still no good luck.

 I've got a checkbox on my form not checked by default and it's up to
 the user to select it.

 input id=chk01 name=chk01 type=checkbox

 I then want to detect if user has selected it or not in jQuery
 (triggered by some event)

 I've tried to use $(#chk01).attr(checked) which always gives me
 undefined value no matter if it is checked or not.

 Also tried $(#chk01).is(':checked') which always gives me 'false' no
 matter if it is checked or not.

 I did this in FFox with FireBug. I also noticed that as user check/
 uncheck the box, the underlying html is not updated (always remains
 initial value), which is probably why the attr function is unable to
 pick up the value.

 Can anyone help?

 Thanks,

 Eric


[jQuery] Re: Find if a checkbox is ticked or not by user

2009-04-08 Thread MorningZ

and to note, as long as the ID of that checkbox is indeed chk01, you
can always use simple JavaScript (which jQuery uses under the hood
anyways)

document.getElementById(chk01).checked



On Apr 8, 2:15 am, Eric morningsunsh...@gmail.com wrote:
 Hi,

 I am having a simple issue but can't get it work. I've searched other
 similar posts but still no good luck.

 I've got a checkbox on my form not checked by default and it's up to
 the user to select it.

 input id=chk01 name=chk01 type=checkbox

 I then want to detect if user has selected it or not in jQuery
 (triggered by some event)

 I've tried to use $(#chk01).attr(checked) which always gives me
 undefined value no matter if it is checked or not.

 Also tried $(#chk01).is(':checked') which always gives me 'false' no
 matter if it is checked or not.

 I did this in FFox with FireBug. I also noticed that as user check/
 uncheck the box, the underlying html is not updated (always remains
 initial value), which is probably why the attr function is unable to
 pick up the value.

 Can anyone help?

 Thanks,

 Eric


[jQuery] Re: How to tell apart focus event

2009-04-08 Thread Karl Swedberg
The only problem I see with this is if the user is tabbing through a  
document/form. The mouse could be anywhere, but the user is still  
manually focussing/blurring.


--Karl


Karl Swedberg
www.englishrules.com
www.learningjquery.com




On Apr 8, 2009, at 2:31 AM, Jordon Bedwell wrote:



Use the mouse to detect said events would sound logical to me.  On  
the focus
trigger, have the script check if the mouse is in the area of the  
object
and if it is assume that it was user triggered and continue,  
othewise assume

it was a method of the application.

-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com]  
On

Behalf Of Klaus Hartl
Sent: Tuesday, April 07, 2009 11:09 PM
To: jQuery (English)
Subject: [jQuery] Re: How to tell apart focus event


In the past I distinguished between true and triggered events via the
e.clientX property (a triggered event has no such property). Not sure
if it's the same with focus events (especially since you're calling
elem.focus and there is no elem.click) and if there is a better way...

--Klaus


On 6 Apr., 04:24, bob xoxeo...@gmail.com wrote:

Hi,
form
   Name: input type=text id=my_name name=my_name
/form

Is it possible to tell apart focus event?

jQuery(#my_name).focus(function (evt) {

if( ??? ){

//execute this if focus was triggered by user  
clicking on

the text

field
}
else {
//execute this if focus was triggered by method  
call like

this

//document.getElementById(my_name).focus();

}

});








[jQuery] Newbie help on Radio select

2009-04-08 Thread TC

Hi all,

I'm new to Jquery and I have a problem I'd like to ask. I've followed
a code snippet online to add a background color to a table column, but
my problem is that when the 2nd row is selected, the 1st row
disappears. How can I make each row remain on the td I've selected?

Here's the code:

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN http://www.w3.org/
TR/html4/strict.dtdhtml
head
title/title
script src=http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/
jquery.min.js type=text/javascript/script
script type=text/javascript
$(document).ready(function(){
$('td').click( function(){
$('td.selected').removeClass('selected');

$(this).addClass('selected').children(inp...@type=radio]).click();
});
});
/script

style type=text/css
td { color: #000; }
td.selected { background-color: #ccc; }
/style


/head
body
table
tr
tdRed input type=radio name=color value=red 
//td
tdBlue input type=radio name=color value=blue 
//td
tdGreen input type=radio name=color 
value=green //td
/tr
tr
tdApple input type=radio name=color 
value=apple //td
tdOranges input type=radio name=color 
value=oranges //
td
tdPears input type=radio name=color 
value=pears //td
/tr
/table
/body
/html


[jQuery] How can I freeze the title row in a table?

2009-04-08 Thread Matt Wilson

I have a table with lots of rows, and when I scroll down, I can't see
the row with the column titles.

How can I freeze that row in place so I can still see it as I scroll
down?


[jQuery] magical setTimeout in IE

2009-04-08 Thread adudczak

Hi,

I'm not an expert in this, I've checked list archive and I didn't find
nothing similar. If You know why this is happening please let me know.

HTML is something like that:

form name=test method=get action=something
  input name=handler id=browser type=radio value=browser
checked=checked class=defaultHandler/
  input name=handler id=browser2 type=radio value=browser2  /

  input type=submit name=submit_ value=submit /
/form

script adds function to click event of both radios and invokes click()
on first one.

script type=text/javascript!--
$(document).ready(function(){
   $('input[name=handler]').click(function() {
alert(this.id);
   });
  $('input[name=handler]:first').click();
});
// --/script

In IE 6.0 click() was not invoked. I've changed line with invocation
to get this:
 $('.defaultHandler').click(); didn't helped. But after adding
setTimeout
(setTimeout('$(.defaultHandler).click()',400);) it works like a
charm. Can someone explain me what
is going on? Why do I have use such a tricks? DOM manipulation in IE
can be that slow...

regards, Adam


[jQuery] [validate] Dotnetnuke and form validation

2009-04-08 Thread caroig

Hi,
I'm using dotnetnuke cms in a current development and I'd really to
use validate for my forms.  I haven't actually tried it but I know
that the entire page in DNN is rendered as a form and that 'forms'
within the page are psuedo forms - i.e. a group of inputs normally
wrapped in a DIV and with some psuedo submit code  on the accept
button.

If I point validate at the DIV wrapping my 'form' fields will it work
(or is it looking for the form element).  Can I intercept the pseudo
submit button with the plugin?

The contact form on the dotnetnuke home page is a good example of what
I am talking about:-
http://www.dotnetnuke.com/About/Contact/tabid/799/Default.aspx

Thanks,


[jQuery] Something like this

2009-04-08 Thread my . analytics


Hey Folk,

I saw thes two nice sites and want to try out, how this will work.

http://www.imagesource.com/
http://www.realities-united.de/

What do I mean?
I mean the full filled backgroundimage, that resize after scale the
browser.

Does somebody know a tutorial or an other approach.

Thakxx for your help
Best regards
JAN
*
-- 
Neu: GMX FreeDSL Komplettanschluss mit DSL 6.000 Flatrate + Telefonanschluss 
für nur 17,95 Euro/mtl.!* 
http://dslspecial.gmx.de/freedsl-surfflat/?ac=OM.AD.PD003K11308T4569a


[jQuery] Re: JQuery, JqGrid, and Ajax

2009-04-08 Thread Natkeeran L.K.

Hello Tony:

I think I got this functionality working.
http://pssnet.com/~devone/ajqtable/summary392.html
I thought I needed Ajax function to get this working.  But, it seems I
don't need that.  datatype: function(postdata)...I don't need this
stuff.

Thank you again for this help, and for a really good plugin.


Regards,
Nat


script type=text/javascript


jQuery(document).ready(function(){

jQuery(#list2).jqGrid({

url:'summary3.php?nd='+new Date().getTime(),

datatype: json,

colNames:['Id', 'Services'],

colModel:[

{name:'service_id',index:'service_id', width:75},

{name:'name',index:'name', width:175},

],

pager: jQuery('#pager2'),

rowNum:10,

rowList:[10,20,30],

imgpath: 'themes/sand/images',

sortname: 'id',

viewrecords: true,

sortorder: asc,



ondblClickRow: function(id){
var x = id;
alert(You double click row with id: +id);
jQuery(#list3).setGridParam({url:'get_services.php?
name='+x}).trigger
(reloadGrid)
  //jQuery(#list3).trigger(reloadGrid);
},  //end ondblClickRow function

   caption: Services


});


 jQuery(#list3).jqGrid({


datatype: json,

colNames:['Product No', 'Name', 'type'],

colModel:[

{name:'product_id',index:'product_id', 
width:75},

{name:'name',index:'name', width:100},

{name:'type',index:'type', width:100},

],

pager: jQuery('#pager3'),

rowNum:10,

rowList:[10,20,30],

imgpath: 'themes/sand/images',

sortname: 'id',

viewrecords: true,

sortorder: asc
});



});

/script

On Apr 8, 10:08 am, Tony t...@trirand.com wrote:
 Hello,
 Maybe you do not understand me.
 The definition
 jQuery(#list3).jqGrid({ ..})

 should be outside of ondblClickRow.
 That is:

 jQuery(document).ready(function(){
 //begin list2 grid
 var x;
 jQuery(#list2).jqGrid({
 ...
  ondblClickRow: function(id){
    var x = id;
     alert(You double click row with id: +id);
     jQuery(#list3).trigger(reloadGrid);},
 ...
 });

 // end of list2 grid

 // begin list3 grid
 jQuery(#list3).jqGrid({...})
 // end list3 grid

 }); // end document ready

 Hope this help.

 On Apr 8, 4:07 pm, NatkeeranL.K. natkee...@gmail.com wrote:

  Hello Tony:

  Thank you for the reply.

  I inserted like below.  But, it does not load the 
  data:http://pssnet.com/~devone/ajqtable/summary36.html.  Just empty grid.

  I also tried to inserted like jQuery(#list3).trigger
  (reloadGrid).jqGrid({no success.

  I just need the functionality, thus any sample code that works...I'll
  adopt.

  Thanks again for the time.

  Regards,
  Nat

  ondblClickRow: function(id){
                  var x = id;
                  alert(You double click row with id: +id);
                  jQuery(#list3).trigger(reloadGrid);
                          // Load Dynamic Data
                  jQuery(#list3).jqGrid({

                                  datatype: function(postdata){
                                          jQuery.ajax({
                                          url:'get_services.php?name='+x,
                                          data:postdata,

                                          datatype: json,
                                          type: 'POST',
                                          contentType: application/json; 
  charset=utf-8,
                                          complete: function (jsondata, stat){
                                                          if(stat==success){

                                                          var thegrid = 
  jQuery(#list3)[0];
                                                          
  thegrid.addJSONData(eval((+jsondata.responseText+)));
                                                                          
  alert(yes);
                                                                          }
                                                                  else{
                                                                          
  alert(no);
                                                                          }
                                                                  } // end 
  complete
                                                  }); // end ajax
                                                  }, // end datatype

                          colNames:['Product No', 'Name', 'type'],

                          colModel:[

                                  {name:'product_id',index:'product_id', 
  width:75},

                                  {name:'name',index:'name', 

[jQuery] prepend() and add events to prepended elements

2009-04-08 Thread dreame4

Hi,

I have such a piece of code:

$('body').prepend('div id=lightboxdiv class=lb-displaydiv
class=lb-bgdiv class=header no-bg sidh2 class=headerEmbed
Code/h2a href=# class=popupExitexit/a/div/div/div/
div');

Then I would like to add a click event to a.popupExit but it doesn't
work correctly. I'm doing it in this way:

$('a.popupExit').click(function() {
$('#lightbox').css(display, none);
return false;
});

Anyone can give me some clue how to do it right?

With regards,
Adam



[jQuery] Re: How can I freeze the title row in a table?

2009-04-08 Thread Andy Matthews

Use Excel?

:) 

-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of Matt Wilson
Sent: Wednesday, April 08, 2009 9:53 AM
To: jQuery (English)
Subject: [jQuery] How can I freeze the title row in a table?


I have a table with lots of rows, and when I scroll down, I can't see the
row with the column titles.

How can I freeze that row in place so I can still see it as I scroll down?




[jQuery] Re: How can I freeze the title row in a table?

2009-04-08 Thread Liam Potter


I remember seeing a plugin that did this, can't remember what it was 
called though.
Basically, what that plugin did. was if it detected the thead scroll out 
of view, it would place a copy of it in the DOM in it's own div, set to 
position:fixed.


This way you emulate the table scrolling down, but the titles staying in 
place.


Andy Matthews wrote:

Use Excel?

:) 


-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of Matt Wilson
Sent: Wednesday, April 08, 2009 9:53 AM
To: jQuery (English)
Subject: [jQuery] How can I freeze the title row in a table?


I have a table with lots of rows, and when I scroll down, I can't see the
row with the column titles.

How can I freeze that row in place so I can still see it as I scroll down?


  


[jQuery] Re: prepend() and add events to prepended elements

2009-04-08 Thread Liam Potter


You will need to use live

$('a.popupExit').live(click, function() {
$('#lightbox').css(display, none);
return false;
});




dreame4 wrote:

Hi,

I have such a piece of code:

$('body').prepend('div id=lightboxdiv class=lb-displaydiv
class=lb-bgdiv class=header no-bg sidh2 class=headerEmbed
Code/h2a href=# class=popupExitexit/a/div/div/div/
div');

Then I would like to add a click event to a.popupExit but it doesn't
work correctly. I'm doing it in this way:

$('a.popupExit').click(function() {
$('#lightbox').css(display, none);
return false;
});

Anyone can give me some clue how to do it right?

With regards,
Adam

  


[jQuery] Re: How can I freeze the title row in a table?

2009-04-08 Thread Jonathan Vanherpe (T T NV)


Matt Wilson wrote:

I have a table with lots of rows, and when I scroll down, I can't see
the row with the column titles.

How can I freeze that row in place so I can still see it as I scroll
down?

I don't think you can, unless there's a way of using position:fixed on 
table rows (but it would really surprise me if that worked, especially 
crossbrowser).


If the width of the columns is fixed, you could also use 2 tables. One 
with the top row and position:fixed, and the other with the real data.


Or you'd have to somehow construct a faux table with divs and stuff, but 
I doubt that's worth the trouble.


Jonathan

--
Jonathan Vanherpe - Tallieu  Tallieu NV - jonat...@tnt.be


[jQuery] Re: How can I freeze the title row in a table?

2009-04-08 Thread JohnZ

http://www.webtoolkit.info/scrollable-html-table.html


On Apr 8, 9:53 am, Matt Wilson m...@tplus1.com wrote:
 I have a table with lots of rows, and when I scroll down, I can't see
 the row with the column titles.

 How can I freeze that row in place so I can still see it as I scroll
 down?


[jQuery] [validate] Either this field OR this field OR both

2009-04-08 Thread neilmbrewer

Using the validate plugin, I need to validate if either one field OR
another has been filled in. It's fine if both fields have been filled
in as well.

Can anyone think of a way to make that happen?

Thanks!


[jQuery] Re: Adding scope support to .bind()

2009-04-08 Thread gregory

the only difficulty I am having with
Balazs Endresz's approach (which I have also
implemented in my environment) is if another developer passes a
function as 'data' param, the results become unpredictable. Though I
don't *think* anybody should be passing a function to access as
event.data, it currently does work to do so.

though changing the pattern to no longer have the handler as the last
param may cause minor confusion, it should not cause any backward
compatibility issues.

I have never bench marked the performance of 'return toString.call
(obj) === [object Function];' Is this faster than running typeof obj
=== function ?

very, very interested in seeing the core of jquery improved to include
a capability to apply correct scope to the handler function

thanks!
-gregory

On Mar 29, 3:26 am, Azat Razetdinov razetdi...@gmail.com wrote:
 From the updated jQuery 1.4 Roadmap:

  If you need a different object for the scope, why not use the data argument 
  to transport it?

 In OOP-style applications the handler is often not an anonymous
 function but a link to the current objects's prototype method:

 this._input.bind('change', this._onInputChange, this);

 And all prototype methods expect that 'this' points to the current
 object. If one needs the jQuery object, he could happily use
 event.currentTarget to reach it.

 One would recommend binding all handlers with anonymous functions,
 e.g.:

 var that = this;
 this._input.bind('change', function (event) { that._onInputChange
 (event) });

 1. It's more verbose. 2. There's no way to unbind this handler.

 On Feb 23, 11:56 pm, Azat Razetdinov razetdi...@gmail.com wrote:

  Passing handler after scope is not suitable for two reasons:

  1. There's no way to determine whether data or scope is passed in a
  three-argument method call.
  2. Passing scope after handler is common pattern in JavaScript 1.6
  methods like forEach.

  On Dec 25 2008, 11:08 pm, Eduardo Lundgren

  eduardolundg...@gmail.com wrote:
   The isFunction is faster now but still has more coast that when you don't
   need to call it.

   We should keep the handler as the last parameter to fit with the jQuery 
   API,
   the change is compatible with it.

     $('div').bind('click', {data: true}, scope, *scope.internalHandler*);

   Scoping events is a good addition to jQuery.

   Ariel, Joern, John? Let me know if it make sense for you.

   Thanks,
   Eduardo Lundgren

   On Thu, Dec 25, 2008 at 11:57 AM, Balazs Endresz
   balazs.endr...@gmail.comwrote:

True, but the new isFunction is a couple of times faster than the old
one, though it's still many times faster to directly call
Object.prototype.toString, which is far below 0.001ms. But as the
callback function is the last parameter everywhere in jQuery it might
be confusing to change this pattern, it just looked more like binding
the function with a native method for me.

On Dec 25, 7:06 pm, Eduardo Lundgren eduardolundg...@gmail.com
wrote:
 Hi Balazs,

 Thanks for give us your opinion.

 When you use $.isFunction(data) on the bind method it is very 
 expensive
when
 you have a lot of iterations.

 Diff the file I attached with the original file (rev. 5996) I made 
 only a
 small change on the bind() method, and it's compatible with data and 
 with
 out API.

 On Thu, Dec 25, 2008 at 3:05 AM, Balazs Endresz 
balazs.endr...@gmail.comwrote:

  Hi, I think this would be really useful! I've also modified jQuery 
  to
  do this a while ago (1.2.6) but with the new scope being the last
  argument, so it works without the data object as well:

  jQuery.fn.bind=function( type, data, fn, bind ) {
                 return type == unload ? this.one(type, data, fn) :
  this.each
  (function(){
                         if( $.isFunction(data) )
                                 jQuery.event.add( this, type, data,
bind, fn
  );
                         else
                                 jQuery.event.add( this, type, fn, 
  data,
bind
  );
                 });
         }

  jQuery.event = {
         add: function(elem, types, handler, data, bind) {
                 if ( elem.nodeType == 3 || elem.nodeType == 8 )
                         return;

                 if( bind != undefined )
                         handler = jQuery.bind(handler, bind); 
  //change
scope
  ...

  jQuery.each( 
  (blur,focus,load,resize,scroll,unload,click,dblclick, +

 mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,
  +
         
  change,select,submit,keydown,keypress,keyup,error).split(,),
  function(i, name){

         // Handle event binding
         jQuery.fn[name] = function(fn, bind){ //second argument for 
  the
  scope
                 return fn ? this.bind(name, fn, bind) :
this.trigger(name);
    

[jQuery] Re: How can I freeze the title row in a table?

2009-04-08 Thread aquaone
There are hacks but none that work well cross-browser without additional
hacks. Some plugins use the two table solution, some don't use tables at all
and replace them with divs.
Have you considered using pagination instead of a fixed thead hack?

aquaone

On Wed, Apr 8, 2009 at 07:53, Matt Wilson m...@tplus1.com wrote:


 I have a table with lots of rows, and when I scroll down, I can't see
 the row with the column titles.

 How can I freeze that row in place so I can still see it as I scroll
 down?



[jQuery] Re: How can I freeze the title row in a table?

2009-04-08 Thread Liam Potter


that's a pretty cool script.

JohnZ wrote:

http://www.webtoolkit.info/scrollable-html-table.html


On Apr 8, 9:53 am, Matt Wilson m...@tplus1.com wrote:
  

I have a table with lots of rows, and when I scroll down, I can't see
the row with the column titles.

How can I freeze that row in place so I can still see it as I scroll
down?



[jQuery] Re: Newbie help on Radio select

2009-04-08 Thread Charlie Griefer
On Wed, Apr 8, 2009 at 7:14 AM, TC inscr...@gmail.com wrote:


 Hi all,

 I'm new to Jquery and I have a problem I'd like to ask. I've followed
 a code snippet online to add a background color to a table column, but
 my problem is that when the 2nd row is selected, the 1st row
 disappears. How can I make each row remain on the td I've selected?


your click handler on the td element is doing this:
$('td.selected').removeClass('selected');

that's removing the 'selected' class.  get rid of that line, and the
previously applied class will remain.

note tho, that you have radio buttons... are you wanting people to be able
to select more than 1 item from each group?  if so, you'll want to go with
checkboxes.

-- 
I have failed as much as I have succeeded. But I love my life. I love my
wife. And I wish you my kind of success.


[jQuery] Re: [validate] Either this field OR this field OR both

2009-04-08 Thread Matt Quackenbush
pseudocode

rules : {
 thisField : {
  depends: function(element) {
   return $('#thatField').length == 0;
  }
 }
 thatField : {
  depends: function(element) {
   return $('#thisField').length == 0;
  }
 }
}

/pseudocode

Check the plugin docs for more info.

http://docs.jquery.com/Plugins/Validation/


[jQuery] Re: [validate] Either this field OR this field OR both

2009-04-08 Thread Matt Quackenbush
Ooops...

pseudocode

rules : {
 thisField : {
  required: true,
  depends: function(element) {
   return $('#thatField').length == 0;
  }
 }
 thatField : {
  required: true,
  depends: function(element) {
   return $('#thisField').length == 0;
  }
 }
}

/pseudocode


[jQuery] Re: Flash content over BlockUI on Firefox in Windows

2009-04-08 Thread James Diamond

My comment was in accurate about it working in all other browsers.
Safari on Mac is fine.  However Safari  Opera on Windows both do the
same thing as firefox.  I have not tested Linux at this point.


[jQuery] Re: How can I freeze the title row in a table?

2009-04-08 Thread Matt Kruse

On Apr 8, 9:53 am, Matt Wilson m...@tplus1.com wrote:
 I have a table with lots of rows, and when I scroll down, I can't see
 the row with the column titles.
 How can I freeze that row in place so I can still see it as I scroll
 down?

There isn't a good solution that will work across all browsers, IMO.

Since I only needed a solution for this in IE, I created this, which
has frozen footers and columns, too:

http://www.javascripttoolbox.com/lib/scrollingdatagrid/

and another approach, which works well for long tables on a page that
you don't want to have inside a scrolling window:

http://www.javascripttoolbox.com/lib/floatingheader/

Hope that helps,

Matt Kruse


[jQuery] Re: Something like this

2009-04-08 Thread Jack Killpatrick


this might do it for you:

http://buildinternet.com/2009/02/supersized-full-screen-backgroundslideshow-jquery-plugin/

- Jack

my.analyt...@gmx.de wrote:

Hey Folk,

I saw thes two nice sites and want to try out, how this will work.

http://www.imagesource.com/
http://www.realities-united.de/

What do I mean?
I mean the full filled backgroundimage, that resize after scale the
browser.

Does somebody know a tutorial or an other approach.

Thakxx for your help
Best regards
JAN
*
  





[jQuery] Re: [validate] Either this field OR this field OR both

2009-04-08 Thread Jörn Zaefferer
Actually:

rules : {
 thisField : {
  required: function(element) {
   return $('#thatField').length == 0;
  }
 },...


On Wed, Apr 8, 2009 at 6:49 PM, Matt Quackenbush quackfu...@gmail.com wrote:
 Ooops...

 pseudocode

 rules : {
  thisField : {
   required: true,
   depends: function(element) {
    return $('#thatField').length == 0;
   }
  }
  thatField : {
   required: true,
   depends: function(element) {
    return $('#thisField').length == 0;
   }
  }
 }

 /pseudocode




[jQuery] Terrible print styles in the docs

2009-04-08 Thread Thomas Allen

Printed documentation includes many superfluous elements and cuts off
the right side of the page in certain browsers. I know CSS like the
back of my hand; is there something I can do to correct this? I'd be
happy to.

http://docs.jquery.com/skins/common/commonPrint.css - Missing quite a
bit

Thomas


[jQuery] Re: Flash content over BlockUI on Firefox in Windows

2009-04-08 Thread Leonardo K
I know you said you tested it, but the parameters that I use and always
works are:

param name=wmode value=transparent/

On Wed, Apr 8, 2009 at 13:53, James Diamond djdiam...@gmail.com wrote:


 My comment was in accurate about it working in all other browsers.
 Safari on Mac is fine.  However Safari  Opera on Windows both do the
 same thing as firefox.  I have not tested Linux at this point.


[jQuery] Re: Terrible print styles in the docs

2009-04-08 Thread Ralph Whitbeck
Thomas,

You could submit a bug and if you want to help submit a patch to the bug and
I am sure the team will consider it.

Thanks,
Ralph

On Wed, Apr 8, 2009 at 1:50 PM, Thomas Allen thomasmal...@gmail.com wrote:


 Printed documentation includes many superfluous elements and cuts off
 the right side of the page in certain browsers. I know CSS like the
 back of my hand; is there something I can do to correct this? I'd be
 happy to.

 http://docs.jquery.com/skins/common/commonPrint.css - Missing quite a
 bit

 Thomas


[jQuery] treeview

2009-04-08 Thread Almudena

Hi,
I would like to know if it is possible to link treeview links to
anchor tags rather than to a whole html page. Any help will be much
appreciated.
Thanks.


[jQuery] Re: Jquery makes two ajax requests in one!!

2009-04-08 Thread James

Skyblaze, is it possible for you to put up the page, or a sample page
with the same issue that we can take a look at the issue?

Also, what about other scripts on your page. Maybe you might have ajax
options set elsewhere that is causing your issue.


On Apr 8, 1:20 am, Joseph Le Brech jlebr...@hotmail.com wrote:
  $.ajax(

  //here then look in the dom inspector, you may see and array with two 
 elements instead of just one

 {



  Date: Wed, 8 Apr 2009 03:54:16 -0700
  Subject: [jQuery] Re: Jquery makes two ajax requests in one!!
  From: marcomenozz...@gmail.com
  To: jquery-en@googlegroups.com

  whre i have to put this breakpoint in firebug?

  On Apr 8, 12:45 pm, donb falconwatc...@comcast.net wrote:
   I would breakpoint 'deeper', down in the ajax code such as where
   ajaxStart is called.  Then check the stack to see how you got there.

   On Apr 8, 4:53 am, Skyblaze marcomenozz...@gmail.com wrote:

I already tried to debug with firebug and i saw that the callback
(with the ajax request code in it) in the event handler function is
just called once. Then i also putted an alert in the event handler and
as i said before i see in output only one alert box so the event
handler callback is just called once. I don't change anything in the
origjnal selectbox

On Apr 8, 10:49 am, Joseph Le Brech jlebr...@hotmail.com wrote:

 Can you put a breakpoint to see if it runs change twice?

 Do you change the value and the text or something similar?

  Date: Wed, 8 Apr 2009 00:49:45 -0700
  Subject: [jQuery] Re: Jquery makes two ajax requests in one!!
  From: marcomenozz...@gmail.com
  To: jquery-en@googlegroups.com

  this is very very strange...any ideas?

  On Apr 8, 1:52áam, Skyblaze marcomenozz...@gmail.com wrote:
   ok i did that and i have only one alert box so the event is fired
   once. So what is that fires two same ajax get request?

   On Apr 8, 1:00áam, James james.gp@gmail.com wrote:

Try adding an alert or console.log in your change event (not 
inside
your ajax success callback) to debug whether the change event is
actually being called once or twice.

On Apr 7, 12:23ápm, Skyblaze marcomenozz...@gmail.com wrote:

 I have no other id with that name and also with firebug 
 suspended it
 is the same.always the same ajax/get request...two 
 identical ajax
 get request one after the other

 On Apr 7, 8:31ápm, Rick Faircloth 
 r...@whitestonemedia.com wrote:

  Make sure you don't have another id called #comprensori_id.
  I had some code left over from experimentation on a page 
  that
  I failed to clear off and every time a certain ajax 
  function ran,
  it did so twice!

  Rick

  -Original Message-
  From: jquery-en@googlegroups.com 
  [mailto:jquery...@googlegroups.com] On

  Behalf Of Skyblaze
  Sent: Tuesday, April 07, 2009 12:31 PM
  To: jQuery (English)
  Subject: [jQuery] Jquery makes two ajax requests in one!!

  I have a strange problem. I have to do an ajax request 
  after a select
  box changes (change event) so i have the following code:

  $('#comprensori_id').change(function() {
  á á á á á á á á á á á á var comprensorio_id = $(this).val();
  á á á á á á á á á á á á $.ajax({
  á á á á á á á á á á á á á á á á á átype: GET,
  á á á á á á á á á á á á á á á á á áurl: ,
  á á á á á á á á á á á á á á á á á ádata: comprensorio_id= 
  +
  comprensorio_id,
  á á á á á á á á á á á á á á á á á ásuccess: function(data, 
  msg){
  á á á á á á á á á á á á á á á á $('#comuni_id').empty();
  á á á á á á á á á á á á á á á á 
  $('#comuni_id').append(data);
  á á á á á á á á á á á á á á á á á á}
  á á á á á á á á á á á á á á á á á});
  á á á á á á á á });

  the problem is that when i change the select box selection 
  my browser
  makes two consecutives same ajax request and i can't figure 
  out
  why...this is very strange

 _
 View your Twitter and Flickr updates from one place – Learn 
 more!http://clk.atdmt.com/UKM/go/137984870/direct/01/

 _
 Beyond Hotmail — see what else you can do with Windows 
 Live.http://clk.atdmt.com/UKM/go/134665375/direct/01/


[jQuery] Attaching tooltip to Ajax Load Event

2009-04-08 Thread iskills

I have a script that loads in data via an .load call:

function listLoad() {
$(#listoflists).load(/cart/admin/files/mailinglist.html,
{nodetails: yes,action:loadlists});
}

This script is called everytime something else is added, again via
a .load event:
$(#do_create_list).click(function(){
$(#create_list_results).load(/cart/admin/files/mailinglist.html,
{nodetails:yes,listname:$('.listname').val
(),action:create_list},setTimeout(listLoad(),400));
});

The issue that I am having, is I am using the tooltip plugin to
display a mouseover event on an icon:
img src='view.png' width='15' height='15' alt='view subscribers'
title='View subscribers to this list' class='display_tooltip'

But that img is loaded via the listLoad function - meaning that it is
not in the initial page call, not a part of the DOM.

I thought that I could use .live(mousemove) to attach this class
(display_tooltip) to the DOM from the .load call, however, it is not
working in conjunction with the tooltip call:
$('.display_tooltip').tooltip({
track:true,
delay:0,
showURL:false,
fade:250
});

So the question is, how can I get this tooltip to work with the image
(there are more than one, the one above is just an example) when these
images would be loaded into the page with the .load call everytime a
certain action (again, the other .load call) is executed?

Hopefully this makes sense...

TIA!


[jQuery] Re: Attaching tooltip to Ajax Load Event

2009-04-08 Thread iskills

I should also mention, that the images are loaded into:
div id='listoflists'/div

in case that affects anything

So, when the page loads:
$(document).ready(function(){
listLoad();
$(#do_create_list).click(function(){

$(#create_list_results).load(/cart/admin/files/mailinglist.html,
{nodetails:yes,listname:$('.listname').val
(),action:create_list},setTimeout(listLoad(),400));
});
function listLoad() {
$(#listoflists).load(/cart/admin/files/mailinglist.html,
{nodetails: yes,action:loadlists});
}
});

page:
div id='new_list_create' style='display: none; text-align: right;'
Enter a List Name to create: input type=text name='listname'
size='40' maxlength='40' class='listname' input type=submit
value='Create List' id='do_create_list'
/div
div id='listoflists'/div



[jQuery] Re: Adding scope support to .bind()

2009-04-08 Thread pete higgins

My hitch() method does this kind of:

http://higginsforpresident.net/js/jq.hitch.js

It would look like:

this._input.bind('change', $.hitch(this, _onInputChange));

Regards,
Peter Higgins

On Wed, Apr 8, 2009 at 12:03 PM, gregory gregory.tomlin...@gmail.com wrote:

 the only difficulty I am having with
 Balazs Endresz's approach (which I have also
 implemented in my environment) is if another developer passes a
 function as 'data' param, the results become unpredictable. Though I
 don't *think* anybody should be passing a function to access as
 event.data, it currently does work to do so.

 though changing the pattern to no longer have the handler as the last
 param may cause minor confusion, it should not cause any backward
 compatibility issues.

 I have never bench marked the performance of 'return toString.call
 (obj) === [object Function];' Is this faster than running typeof obj
 === function ?

 very, very interested in seeing the core of jquery improved to include
 a capability to apply correct scope to the handler function

 thanks!
 -gregory

 On Mar 29, 3:26 am, Azat Razetdinov razetdi...@gmail.com wrote:
 From the updated jQuery 1.4 Roadmap:

  If you need a different object for the scope, why not use the data 
  argument to transport it?

 In OOP-style applications the handler is often not an anonymous
 function but a link to the current objects's prototype method:

 this._input.bind('change', this._onInputChange, this);

 And all prototype methods expect that 'this' points to the current
 object. If one needs the jQuery object, he could happily use
 event.currentTarget to reach it.

 One would recommend binding all handlers with anonymous functions,
 e.g.:

 var that = this;
 this._input.bind('change', function (event) { that._onInputChange
 (event) });

 1. It's more verbose. 2. There's no way to unbind this handler.

 On Feb 23, 11:56 pm, Azat Razetdinov razetdi...@gmail.com wrote:

  Passing handler after scope is not suitable for two reasons:

  1. There's no way to determine whether data or scope is passed in a
  three-argument method call.
  2. Passing scope after handler is common pattern in JavaScript 1.6
  methods like forEach.

  On Dec 25 2008, 11:08 pm, Eduardo Lundgren

  eduardolundg...@gmail.com wrote:
   The isFunction is faster now but still has more coast that when you don't
   need to call it.

   We should keep the handler as the last parameter to fit with the jQuery 
   API,
   the change is compatible with it.

     $('div').bind('click', {data: true}, scope, *scope.internalHandler*);

   Scoping events is a good addition to jQuery.

   Ariel, Joern, John? Let me know if it make sense for you.

   Thanks,
   Eduardo Lundgren

   On Thu, Dec 25, 2008 at 11:57 AM, Balazs Endresz
   balazs.endr...@gmail.comwrote:

True, but the new isFunction is a couple of times faster than the old
one, though it's still many times faster to directly call
Object.prototype.toString, which is far below 0.001ms. But as the
callback function is the last parameter everywhere in jQuery it might
be confusing to change this pattern, it just looked more like binding
the function with a native method for me.

On Dec 25, 7:06 pm, Eduardo Lundgren eduardolundg...@gmail.com
wrote:
 Hi Balazs,

 Thanks for give us your opinion.

 When you use $.isFunction(data) on the bind method it is very 
 expensive
when
 you have a lot of iterations.

 Diff the file I attached with the original file (rev. 5996) I made 
 only a
 small change on the bind() method, and it's compatible with data and 
 with
 out API.

 On Thu, Dec 25, 2008 at 3:05 AM, Balazs Endresz 
balazs.endr...@gmail.comwrote:

  Hi, I think this would be really useful! I've also modified jQuery 
  to
  do this a while ago (1.2.6) but with the new scope being the last
  argument, so it works without the data object as well:

  jQuery.fn.bind=function( type, data, fn, bind ) {
                 return type == unload ? this.one(type, data, fn) :
  this.each
  (function(){
                         if( $.isFunction(data) )
                                 jQuery.event.add( this, type, data,
bind, fn
  );
                         else
                                 jQuery.event.add( this, type, fn, 
  data,
bind
  );
                 });
         }

  jQuery.event = {
         add: function(elem, types, handler, data, bind) {
                 if ( elem.nodeType == 3 || elem.nodeType == 8 )
                         return;

                 if( bind != undefined )
                         handler = jQuery.bind(handler, bind); 
  //change
scope
  ...

  jQuery.each( 
  (blur,focus,load,resize,scroll,unload,click,dblclick, +

 mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,
  +
         
  

[jQuery] Re: magical setTimeout in IE

2009-04-08 Thread James

Without using setTimeout it seems to be working for me on a very basic
page:
http://jsbin.com/ezavi

It should alert 'browser' when the page loads. Works for me on both
FF3.0.8 and IE6
Maybe something else in your code must be causing the issue.

On Apr 8, 3:15 am, adudczak adudc...@gmail.com wrote:
 Hi,

 I'm not an expert in this, I've checked list archive and I didn't find
 nothing similar. If You know why this is happening please let me know.

 HTML is something like that:

 form name=test method=get action=something
   input name=handler id=browser type=radio value=browser
 checked=checked class=defaultHandler/
   input name=handler id=browser2 type=radio value=browser2  /

   input type=submit name=submit_ value=submit /
 /form

 script adds function to click event of both radios and invokes click()
 on first one.

 script type=text/javascript!--
 $(document).ready(function(){
            $('input[name=handler]').click(function() {
                 alert(this.id);
            });
           $('input[name=handler]:first').click();});

 // --/script

 In IE 6.0 click() was not invoked. I've changed line with invocation
 to get this:
  $('.defaultHandler').click(); didn't helped. But after adding
 setTimeout
 (setTimeout('$(.defaultHandler).click()',400);) it works like a
 charm. Can someone explain me what
 is going on? Why do I have use such a tricks? DOM manipulation in IE
 can be that slow...

 regards, Adam


[jQuery] unload garbage collection 1.3.2 patch

2009-04-08 Thread docyes

ISSUE:
Garbage cleanup is not assigned to an anonymous function. Sometimes
unonload is used by other logic that may need jQuery to perform
certain tasks. The ability to unbind/bind the garbage collection
routine is handy to bump execution order.

SUGGESTED SOLUTION:
Assign garbage collection routine to a named closure.

PATCH FILE:
3106,3111c3106,3111
 jQuery( window ).bind( 'unload', function(){
   for ( var id in jQuery.cache )
   // Skip the window
   if ( id != 1  jQuery.cache[ id ].handle )
   jQuery.event.remove( jQuery.cache[ id ].handle.elem );
 });
---
 jQuery.fn.oscarTheGrouch = function(){
 for ( var id in jQuery.cache )
 // Skip the window
 if ( id != 1  jQuery.cache[ id ].handle )
 jQuery.event.remove( jQuery.cache[ id ].handle.elem );
 }; jQuery( window ).bind( 'unload', jQuery.fn.oscarTheGrouch );


[jQuery] Re: Find if a checkbox is ticked or not by user

2009-04-08 Thread James

How are you calling the check? You haven't provided the code for the
actual selection event.
Your code should look along the lines of:

$(#chk01).click(function() {
 if ( $(this).is(':checked') ) {
  // do something
 }
 else {
  // do something else
 }
});

Also, make sure you only have one ID called chk01 on your page.

On Apr 7, 8:15 pm, Eric morningsunsh...@gmail.com wrote:
 Hi,

 I am having a simple issue but can't get it work. I've searched other
 similar posts but still no good luck.

 I've got a checkbox on my form not checked by default and it's up to
 the user to select it.

 input id=chk01 name=chk01 type=checkbox

 I then want to detect if user has selected it or not in jQuery
 (triggered by some event)

 I've tried to use $(#chk01).attr(checked) which always gives me
 undefined value no matter if it is checked or not.

 Also tried $(#chk01).is(':checked') which always gives me 'false' no
 matter if it is checked or not.

 I did this in FFox with FireBug. I also noticed that as user check/
 uncheck the box, the underlying html is not updated (always remains
 initial value), which is probably why the attr function is unable to
 pick up the value.

 Can anyone help?

 Thanks,

 Eric


[jQuery] Re: unload garbage collection 1.3.2 patch

2009-04-08 Thread docyes

Typo:
Garbage cleanup is not assigned to an anonymous function.
Garbage cleanup is assigned to an anonymous function.

On Apr 8, 12:28 pm, docyes doc...@gmail.com wrote:
 ISSUE:
 Garbage cleanup is not assigned to an anonymous function. Sometimes
 unonload is used by other logic that may need jQuery to perform
 certain tasks. The ability to unbind/bind the garbage collection
 routine is handy to bump execution order.

 SUGGESTED SOLUTION:
 Assign garbage collection routine to a named closure.

 PATCH FILE:
 3106,3111c3106,3111
  jQuery( window ).bind( 'unload', function(){
     for ( var id in jQuery.cache )
             // Skip the window
             if ( id != 1  jQuery.cache[ id ].handle )
                     jQuery.event.remove( jQuery.cache[ id ].handle.elem );
  });
 ---

  jQuery.fn.oscarTheGrouch = function(){
      for ( var id in jQuery.cache )
          // Skip the window
          if ( id != 1  jQuery.cache[ id ].handle )
              jQuery.event.remove( jQuery.cache[ id ].handle.elem );
  }; jQuery( window ).bind( 'unload', jQuery.fn.oscarTheGrouch );


[jQuery] Re: unload garbage collection 1.3.2 patch

2009-04-08 Thread Ralph Whitbeck
docyes,

Either submit a bug and add the patch to it or post this to the jquery-dev
group.

Thanks,
Ralph

On Wed, Apr 8, 2009 at 3:35 PM, docyes doc...@gmail.com wrote:


 Typo:
 Garbage cleanup is not assigned to an anonymous function.
 Garbage cleanup is assigned to an anonymous function.

 On Apr 8, 12:28 pm, docyes doc...@gmail.com wrote:
  ISSUE:
  Garbage cleanup is not assigned to an anonymous function. Sometimes
  unonload is used by other logic that may need jQuery to perform
  certain tasks. The ability to unbind/bind the garbage collection
  routine is handy to bump execution order.
 
  SUGGESTED SOLUTION:
  Assign garbage collection routine to a named closure.
 
  PATCH FILE:
  3106,3111c3106,3111
   jQuery( window ).bind( 'unload', function(){
  for ( var id in jQuery.cache )
  // Skip the window
  if ( id != 1  jQuery.cache[ id ].handle )
  jQuery.event.remove( jQuery.cache[ id ].handle.elem
 );
   });
  ---
 
   jQuery.fn.oscarTheGrouch = function(){
   for ( var id in jQuery.cache )
   // Skip the window
   if ( id != 1  jQuery.cache[ id ].handle )
   jQuery.event.remove( jQuery.cache[ id ].handle.elem );
   }; jQuery( window ).bind( 'unload', jQuery.fn.oscarTheGrouch );



[jQuery] Why won't these values work for an ajax function?

2009-04-08 Thread Rick Faircloth
Here's the code:

 

function mSaveSection() {

 

 datavalues  =  { dsn:
'cfoutput#application.dsn#/cfoutput',

section_subtitle:
'cfoutput#session.values.section_subtitle#/cfoutput',

section_text:
'cfoutput#session.values.section_text#/cfoutput'  };

 

The application (or browser) just seems to sit and spin when this is
run.no error, no timeout,

nothing.

 

When I look at the generated code in Firebug, the values are good for the
session variables.

And I use 'cfoutput#application.dsn#/cfoutput' successfully in all other
ajax functions

without problem.

 

When I substitute hard-coded values in place of the session variables, the
function works.

Does anyone familiar with jQuery and ColdFusion session variables know of an
issue with this

approach?

 

Thanks,

 

Rick

 


---

It has been my experience that most bad government is the result of too
much government. - Thomas Jefferson

 



[jQuery] Re: Why won't these values work for an ajax function?

2009-04-08 Thread Charlie Griefer
view the source of the generated page and paste the mSaveSection() here.

On Wed, Apr 8, 2009 at 1:01 PM, Rick Faircloth r...@whitestonemedia.comwrote:

  Here’s the code:



 function mSaveSection() {



  datavalues  =  { dsn:
 ‘cfoutput#application.dsn#/cfoutput’,

 section_subtitle:
 ‘cfoutput#session.values.section_subtitle#/cfoutput’,

 section_text:
  ‘cfoutput#session.values.section_text#/cfoutput’  };



 The application (or browser) just seems to “sit and spin” when this is
 run…no error, no timeout,

 nothing.



 When I look at the generated code in Firebug, the values are good for the
 session variables.

 And I use ‘cfoutput#application.dsn#/cfoutput’ successfully in all
 other ajax functions

 without problem.



 When I substitute hard-coded values in place of the session variables, the
 function works.

 Does anyone familiar with jQuery and ColdFusion session variables know of
 an issue with this

 approach?



 Thanks,



 Rick



 *
 ---
 *

 *It has been my experience that most bad government is the result of too
 much government. - Thomas Jefferson*






-- 
I have failed as much as I have succeeded. But I love my life. I love my
wife. And I wish you my kind of success.


[jQuery] Re: How can I freeze the title row in a table?

2009-04-08 Thread jlcox

Drupal has a standard script to do this, see
http://drupal.org/project/issues/date?status=All
for instance. You might be able to pick apart the source code to adapt
it to your needs.


[jQuery] Triggering a namespaced event

2009-04-08 Thread Paul Thiel

Hi guys.

Using jQuery 1.3.2 and getting some unexpected behavior this morning.

This works, with the alert being executed when the showpalette event
is triggered.

$().bind('showpalette', function() {
   alert('showing palette!');
});

$.event.trigger('showpalette');

However, this does NOT work:

$().bind('show.palette', function() {
   alert('showing palette!');
});

$.event.trigger('show.palette');


What am I missing?  Namespacing your events should be just fine in
this scenario, right?


[jQuery] jQuery.event.trigger()

2009-04-08 Thread Paul Thiel

Hi guys.

Trying again as not sure what happened to the previous post.

I am using jQuery 1.3.2 and getting some unexpected behavior this
morning.

This works, with the alert being executed when the showpalette event
is triggered.

$().bind('showpalette', function() {
  alert('showing palette!');
});

$.event.trigger('showpalette');

However, this does NOT work:

$().bind('show.palette', function() {
  alert('showing palette!');
});

$.event.trigger('show.palette');


Also, trying to trigger the event with an event object, thus:

$.event.trigger({
   type : 'showpalette',
   palette : palette
});

... also does not work with the bound handler seeing 'undefined' as
the second parm (after the event object).

If I trigger the event like this:

$.event.trigger('showpalette', [palette]);

... it is getting though to the handler just fine.


What am I missing?  Namespacing your events should be just fine in
this scenario, right?

Is there something about $.event.trigger() that is different to $
('#elem').trigger()??


  1   2   >