[jQuery] Re: Cascade plugin and multiple selected values

2009-11-18 Thread Mike Nichols
sorry what I meant was jQuery(#chained_child).trigger(cascade)
Please read up on events in jquery and check out the source

On Nov 11, 3:33 pm, rmachado rmachado...@gmail.com wrote:
 Hello and thanks for the reply

 I'm trying to use the solution you propose, but I'm new to jquery and
 I can't make it work.

 My code is:

 jQuery(document).ready(function()
                 {
                         jQuery(#chained_child).cascade(#chained,{
                                 list: list1,
                                 template: commonTemplate,
                                 match: commonMatch
                         });
                         
 jQuery(#chained_sub_child).cascade(#chained_child,{
                                 list: list2,
                                 template: commonTemplate,
                                 match: commonMatch
                         });
                         
 jQuery(#chained_sub_child1).cascade(#chained_child,{
                                 list: list3,
                                 template: commonTemplate,
                                 match: commonMatch
                         });
                 });

         /script

         script type=text/javascript
          function startDrops() {
            $('#chained [value=2').attr('selected','selected').parent().change
 ();
            $('select#parent').trigger('cascade');
            $('#chained_child [value=3').attr('selected','selected').parent
 ().change();

          }
 /head
 body onload=Javascript:startDrops();
 ...

 I tried also:
 $('select#chained').trigger('cascade');

 and several variations...

 But it didn't work. :(

 Can you help me?

 Thanks

 On 11 Nov, 02:06, Mike Nichols nichols.mik...@gmail.com wrote:

  $('select#parent').trigger('cascade');
  ?

  On Nov 9, 5:08 pm, rmachado rmachado...@gmail.com wrote:

   Hello to all

   I using thecascadeplugin in 3 dropdowns and it works fine, but in
   some ocasions I need to pre selected the values because the user is
   editing the previous recorded selections.

   I manage to selected the value of the first dropdown with the
   following code:
   $('#chained [value=1').attr('selected','selected').parent().change();

   but how can I selected the second one and the third?

   I tried this:
   script type=text/javascript
            function startDrops() {
              $('#chained 
   [value=1]').attr('selected','selected').parent().change
   ();
              $('#chained_child 
   [value=3]').attr('selected','selected').parent
   ().change();
            }

           /script
   ...
   body onload=Javascript:startDrops();

   But it didn't work..

   How can I do it?

   Thanks




[jQuery] Re: Cascade plugin and multiple selected values

2009-11-10 Thread Mike Nichols
$('select#parent').trigger('cascade');
?

On Nov 9, 5:08 pm, rmachado rmachado...@gmail.com wrote:
 Hello to all

 I using thecascadeplugin in 3 dropdowns and it works fine, but in
 some ocasions I need to pre selected the values because the user is
 editing the previous recorded selections.

 I manage to selected the value of the first dropdown with the
 following code:
 $('#chained [value=1').attr('selected','selected').parent().change();

 but how can I selected the second one and the third?

 I tried this:
 script type=text/javascript
          function startDrops() {
            $('#chained [value=1]').attr('selected','selected').parent().change
 ();
            $('#chained_child [value=3]').attr('selected','selected').parent
 ().change();
          }

         /script
 ...
 body onload=Javascript:startDrops();

 But it didn't work..

 How can I do it?

 Thanks


[jQuery] Re: Chained Autocomplete selects

2009-07-16 Thread Mike Nichols

You can bind it to a custom event. You don't have to use the change
event on the parent select. Another option is to manually fire the
change event on $.ready().

On Jul 1, 12:01 pm, brotherjames james.montgom...@terex.com wrote:
 Is there an easy way with theCascadeplugin to tie to events in
 addition to change... The issue is that theCascadeworks well when
 the parent is changed but does not show the child value on an update
 form as the parent in most cases do not need to change... but the
 child is not displayed because the change event is not nor does it
 need to be fired.

 On Jun 11, 12:30 am, Mike Nichols nichols.mik...@gmail.com wrote:

  I'd look at the autocomplete plugin 
  herehttp://github.com/ReinH/jquery-autocomplete/tree/master
  and a decent write up here 
  :http://www.bigredswitch.com/blog/2008/11/jquery-autocomplete-plugin/

  I used this tiny plugin as a kind of prototype when I wrotecascade.
  Incidentally, I have a few fixes tocascadeto push out (dynamic ajax,
  etc) if you need it.

  Personally, I wouldn't use a select tag for that many options, but
  would opt for autocomplete. You can use the same datasource (JSON) and
  bind similar behavior on the autocomplete box.

  mike

  On Jun 10, 9:45 pm, netcomp ra...@netcompulsion.com wrote:

   Hi there.  I have a page that loads two other pages in with load.  In
   one of the files there are two select lists,chainedtogether using
   theCascadeplugin.  I have embedded theCascadeplugin in the page
   that gets loaded.  This works fine.

   However, the first list contains upwards of 2200 items and people are
   having trouble finding the proper choice.  So now I need to add a
   filter or auto complete functionality.

   I'm having a problem getting the wheels rolling on this one...anyone
   have an example or suggestion of how I can accomplish both tasks?  The
   current lists are fed by a JSON file I generate dynamically.

   TIA


[jQuery] Namespaced events losing namespace when bubbling up

2009-07-03 Thread Mike Nichols

I have two namespaced events bound like so:
$(body).bind(selected.proctor,function(e,data) { /* stuff*/});
$(body).bind(selected.spg,function(e,data) { /* stuff*/});


Then an anchor  (inside the body of course) fires the event like so:
$(a).trigger(selected.spg,[somedata]);

But both bound event handlers are getting executed. However if I make
the event trigger specific to the bound element things work as
expected :
$(body).trigger(selected.spg,[somedata]);

Am I wrong in assuming the proper namespaced event should be the only
one fired in this case? Is this a bug?
It appears that somehow the namespacing is getting trimmed or ignored
by the time the event has bubbled up.




[jQuery] Re: jquery.ui.cascade null/not an object/undefined, etc etc.

2009-07-02 Thread Mike Nichols

You need to include jquery.cascade.ext.js included in the distro

On Jun 5, 10:16 pm, kranthi kranthi...@gmail.com wrote:
 most possible reason is ui.cascadeis not defined by the time u call
 the above line of code. If ui.cascadeis defined in an external js
 file (sorry i never used this plugin) then the file must have been
 included after calling this line of code.

 other possibility being...
 you are using frames/iframes. the above code is in the child while the
 js file is included in the parent.


[jQuery] Re: Chained Autocomplete selects

2009-06-10 Thread Mike Nichols

I'd look at the autocomplete plugin here 
http://github.com/ReinH/jquery-autocomplete/tree/master
and a decent write up here : 
http://www.bigredswitch.com/blog/2008/11/jquery-autocomplete-plugin/

I used this tiny plugin as a kind of prototype when I wrote cascade.
Incidentally, I have a few fixes to cascade to push out (dynamic ajax,
etc) if you need it.

Personally, I wouldn't use a select tag for that many options, but
would opt for autocomplete. You can use the same datasource (JSON) and
bind similar behavior on the autocomplete box.


mike

On Jun 10, 9:45 pm, netcomp ra...@netcompulsion.com wrote:
 Hi there.  I have a page that loads two other pages in with load.  In
 one of the files there are two select lists, chained together using
 the Cascade plugin.  I have embedded the Cascade plugin in the page
 that gets loaded.  This works fine.

 However, the first list contains upwards of 2200 items and people are
 having trouble finding the proper choice.  So now I need to add a
 filter or auto complete functionality.

 I'm having a problem getting the wheels rolling on this one...anyone
 have an example or suggestion of how I can accomplish both tasks?  The
 current lists are fed by a JSON file I generate dynamically.

 TIA


[jQuery] Re: Cascade plugin help

2009-05-17 Thread Mike Nichols

sorry for the late reply, but you need to fire cascade manually at the
end of the delegate and you can simplify your options, though I'd
consider using $.data for this kind of thing:
var defaultOpts = {
ajax: {url: ‘otherData.js' },
template: commonTemplate,
match: commonMatch,
event: state.changed
};
var OR = $.extend({},defaultOpts,{ ajax: {url: ‘orData.js' } });
var WA = $.extend({},defaultOpts,{ ajax: {url: ‘wasData.js' } });

//THen in your delegate:

jQuery(.container-2 select).each(function() {
var child = jQuery(this);
child.parents
(.container-2:first).siblings(.container-1).find
(select).each(function() {
//below I want to compare the verable to the different options I have
above
if(currentState ==
'OR'){
child.cascade(jQuery
(this),OR);
}
if(currentState ==
'WA'){
child.cascade(jQuery
(this),WA);
}
else{
child.cascade(jQuery
(this),opts);
}
});
child.trigger(state.changed);
});



On Apr 17, 12:04 pm, Chrisw chris.p.wel...@gmail.com wrote:
 I forgot to say what my issue is.  It dose load anything if I remove
 the if statments it works fine.

 On Apr 17, 11:50 am, Chrisw chris.p.wel...@gmail.com wrote:

  I am new to jquery and I need to make a form that allows a user to
  select a state and a city that they go to school in. I am using 
  thecascadejuqery plug-in (http://plugins.jquery.com/project/cascade.
  Which I think is a greatplugin) The problem is there is a lot of data
  and it takes a long time for it all to load (some 28,000 records).
  What I want to do is split it up into different files and then load
  only the file that contains the data for that start/region. A sample
  of my code is blow:

  My html:
                  div class=container-1
                          label for=rsvp_stateState/label
                                  select id=rsvp_state
                                          option value=Pick a 
  State/option
                                          option value=OROregon/option
                                          option 
  value=WAWashington/option
                                          option 
  value=CACalifornia/option
                                  /select
                  /div
                  div class=container-2
                          label for=rsvp_cityPick a City/label
                                  select id=rsvp_city
                                  /select
                  /div

  //below are the different loads that contain different data based on
  the state
                                          var OR = {
                                                  ajax: {url: ‘orData.js' },
                                                  template: commonTemplate,
                                                  match: commonMatch
                                          };
                                          var WA = {
                                                  ajax: {url: ‘waData.js' },
                                                  template: commonTemplate,
                                                  match: commonMatch
                                          };
                                          var opts = {
                                                  ajax: {url: ‘otherData.js' 
  },
                                                  template: commonTemplate,
                                                  match: commonMatch
                                          };

                          $(document).ready(function() {
                                  var currentState;
  // #rsvp_state refers to a dropdown menu that contains all the states
  //what I want to do with this is determine what state is currently //
  selected and store that in a variable
                                  
  $('#rsvp_state').change(function(){currentState = $
  ('#rsvp_state').val();});

                                  jQuery(.container-2 
  select).each(function() {
                                          var child = jQuery(this);
                                          
  child.parents(.container-2:first).siblings(.container-1).find
  (select).each(function() {
  //below I want to compare the verable to the different options I have
  above
                                                  if(currentState == 'OR'){
                                                  
  

[jQuery] Re: bubbling of triggered events... ?

2009-05-16 Thread Mike Nichols

can you show some code that isn't working

On May 16, 6:21 am, jayarjo jaya...@gmail.com wrote:
 New in jQuery 1.3:

 All triggered events now bubble up the DOM tree. For example if you
 trigger an event on a paragraph then it will trigger on that element
 first, then on the parent element, and its parent, and so on up to the
 document. The event object will have a .target property equal to the
 original triggered element. You can prevent the bubbling by calling
 stopPropagation() or by returning false from your 
 callback.http://docs.jquery.com/Events/trigger#eventdata

 In other words triggered event should bubble up to it's parent
 container, should it? If yes, then I want to catch it on parents level
 and trigger it on another child of choice, and so on. But it doesn't
 seem to bubble... :(

 Any help appreciated.


[jQuery] Re: Global variables in jQuery

2009-05-13 Thread Mike Nichols

'price' value won't be set until the callback completes, so try this:
unction calc_matrix(x, y)
{
loc = index.php?module=product;

var price = 0;
$.post(loc,
{
request:xmlhttp,
action:calc_pricematrix,
x:x,
y:y
},
function(data)
{
price = Math.round(parseFloat(data)*100)/100;
alert(price);
});


On May 13, 1:02 am, V vincenti...@gmail.com wrote:
 I can't get global variables work, maybe somebody knows the answer
 because this should be very simple.

 The following does not work, the price is not available at the end of
 the function in the alert.

 function calc_matrix(x, y)
 {
         loc = index.php?module=product;

         var price = 0;
         $.post(loc,
         {
                 request:xmlhttp,
                 action:calc_pricematrix,
                 x:x,
                 y:y
         },
         function(data)
         {
                 price = Math.round(parseFloat(data)*100)/100;

         });
         alert(price);

 }


[jQuery] Re: empty() is faking ?

2009-05-04 Thread Mike Nichols

this is probably due to the refresh problems in firebug

On May 4, 7:33 am, Olivier Percebois-Garve perceb...@gmail.com
wrote:
 Hi

 I'm puzzled with this :http://pastebin.me/49fef93928aff

 (in firebug click on the jquery object, then expand 0)

 Using empty() or remove() on the lis of a ul, it seems that jQuery is
 faking to remove them,
 i.e the lis will not be accessible by jQuery anymore, but in reality the
 childnodes are still there.
 Well, at least that's what I can believe from firebug. (Not sure who's
 the liar here jQuery, firebug, or me being dumb)

 I'm facing an issue that gets down to that, I really dont understand
 whats going on and how to handle it.
 (using jQuery 1.2.6)

 I hope I am missing the obvious. Am I ?

 -Olivier


[jQuery] Re: how to make an alert before processing a form

2009-04-28 Thread Mike Nichols

subscribe (bind) to your form's 'submit' event . show your alert and
return true/false accordingly...false will prevent the form from
submitting.

On Apr 28, 5:59 am, hybris77 dist...@yahoo.com wrote:
 i might be tired right now but I cannot seem to figure out
 a good way to show an alert before processing a form,
 the form is not processed using AJAX, just passed
 on to a PHP script

 I might however want to implement AJAX when processing
 the form, hmmm, maybe that will sort me out then I guess

 /pär


[jQuery] Re: jQuery $.ajax and dataType

2009-04-10 Thread Mike Nichols

I posted on this and submitted on the ticket tracker to do this but it
seems to have been denied (it was abandoned).
There was a suggestion made to use the dataFilter but that misses the
point since the xhr header doesn't get included as a parameter.
To work around this I have a little patch I add just after my jquery
include. You can see it here :
http://devlicio.us/blogs/mike_nichols/archive/2008/10/14/enabling-auto-detection-of-response-type-in-jquery.aspx



On Apr 10, 3:39 pm, Snef sne...@gmail.com wrote:
 Well, is it a good suggestion?

 Or maybe it's possible to override (or extends) tjhe current ajax
 implementation?

 On 10 apr, 16:45, Snef sne...@gmail.com wrote:

  Hi,

  When using the $.ajax functionality i came across some things.

  You have to set the dataType option in order to get the correct data
  at success(). Now I have an ajax request that can return some html or
  json. Both use the correct content-type header.

  Now I see in the httpData function of jQuery that it will get xml and
  in other occasions it will use the set dataType. Why not a check on
  content-type?

  In the httpData is a part like:

                  // The filter can actually parse the response
                  if( typeof data === string ){
                          // If the type is script, eval it in global 
  context
                          if ( type == script )
                                  jQuery.globalEval( data );

                          // Get the JavaScript object, if JSON is used.
                          if ( type == json )
                                  data = window[eval](( + data + ));
                  }

  Maybe it is possible to change it to:

                  // The filter can actually parse the response
                  if( typeof data === string ){
                          // If the type is script, eval it in global 
  context
                          if ( type == script || ( !type  
  ct.indexOf(javascript) =
  0 ) )
                                  jQuery.globalEval( data );

                          // Get the JavaScript object, if JSON is used.
                          if ( type == json || ( !type  
  ct.indexOf(json) = 0 ) )
                                  data = window[eval](( + data + ));
                  }

  (please check the httpData in jquery.1.3.2.js!)

  In this way, when dataType is omitted, it'll take a look at the
  returned content type.

  Offcourse, this is just a quick rewrite and maybe not even correct but
  with some simple tests it worked well.

  Snef


[jQuery] Re: jQuery $.ajax and dataType

2009-04-10 Thread Mike Nichols

great glad it helped. I'll look at 1.3.2 to modify

On Apr 10, 4:01 pm, Snef sne...@gmail.com wrote:
 Exactly what I also want! :)

 Think it needs minor update for 1.3.2 (different way of eval with json
 i think)

 Thanx!

 PS. Strange this was not included in jQuery itself.

 Mike Nichols schreef:

  I posted on this and submitted on the ticket tracker to do this but it
  seems to have been denied (it was abandoned).
  There was a suggestion made to use the dataFilter but that misses the
  point since the xhr header doesn't get included as a parameter.
  To work around this I have a little patch I add just after my jquery
  include. You can see it here :
 http://devlicio.us/blogs/mike_nichols/archive/2008/10/14/enabling-aut...

  On Apr 10, 3:39 pm, Snef sne...@gmail.com wrote:
   Well, is it a good suggestion?

   Or maybe it's possible to override (or extends) tjhe current ajax
   implementation?

   On 10 apr, 16:45, Snef sne...@gmail.com wrote:

Hi,

When using the $.ajax functionality i came across some things.

You have to set the dataType option in order to get the correct data
at success(). Now I have an ajax request that can return some html or
json. Both use the correct content-type header.

Now I see in the httpData function of jQuery that it will get xml and
in other occasions it will use the set dataType. Why not a check on
content-type?

In the httpData is a part like:

                // The filter can actually parse the response
                if( typeof data === string ){
                        // If the type is script, eval it in global 
context
                        if ( type == script )
                                jQuery.globalEval( data );

                        // Get the JavaScript object, if JSON is used.
                        if ( type == json )
                                data = window[eval](( + data + ));
                }

Maybe it is possible to change it to:

                // The filter can actually parse the response
                if( typeof data === string ){
                        // If the type is script, eval it in global 
context
                        if ( type == script || ( !type  
ct.indexOf(javascript) =
0 ) )
                                jQuery.globalEval( data );

                        // Get the JavaScript object, if JSON is used.
                        if ( type == json || ( !type  
ct.indexOf(json) = 0 ) )
                                data = window[eval](( + data + ));
                }

(please check the httpData in jquery.1.3.2.js!)

In this way, when dataType is omitted, it'll take a look at the
returned content type.

Offcourse, this is just a quick rewrite and maybe not even correct but
with some simple tests it worked well.

Snef


[jQuery] Re: Cascade plugin - feature/improvement request (data optimization)

2009-02-04 Thread Mike Nichols

sorry i replied on your other thread:

@james,
There is not a fixed schema for items in cascade. The json structure
is outside the scope of cascade. For smaller lists I might load some
javascript when the page hits and assign the 'url' as the var I gave
it. For larger lists or more complex objects I might just have an ajax
call for each list change event. It just depends. In either case, you
are simply dealing with individual items that simply need to answer
the predicate found in your 'match' option implementation as to
whether they should be hydrated into the child list or not.
Hope this helps
mike


On Feb 3, 9:15 am, James james.tilb...@gmail.com wrote:
 Mike et all:

 Now that I've worked through some of the basics, I would like to know
 how easy it would be to accommodate a JSON file in a bit of a more
 efficient structure using arrays rather than simple value pairs.

 IE.: You have designed around this structure:
 {'when':'selectedValue','value':'itemValue','text':'itemText'}

 Whereas after some testing, I've realized the data sizes would become
 rather huge rather quickly.

 I'm proposing a JSON structure such as:

 {
     Country1: [
         {
             Region1: [
                 City1,
                 City2,
                 City3
             ],
             Region2: [
                 City1,
                 City2,
                 City3
             ]
         }
     ]

 }

 The idea would be for a separate JSON file for each country (now that
 we've got dynamic URLs working).  (see related discussion: [url]http://
 groups.google.com/group/jquery-en/browse_thread/thread/
 142c1e9e9119b198#[/url]

 Of course this simplified structure would require some parsing and
 reformatting AFTER loading the JSON file to fit the structure used for
 the .CASCADEplugin.

 My problem is, since I'm so new to all this, I have no idea where in
 the code to begin looking at how to take my imported JSON file, and
 then do the work on it to change it into your format.

 Could you offer some insight on this?

 Thanks,
 James


[jQuery] Re: Cascade (chained) works in Firefox but not in IE

2009-02-03 Thread Mike Nichols

@james,
There is not a fixed schema for items in cascade. The json structure
is outside the scope of cascade. For smaller lists I might load some
javascript when the page hits and assign the 'url' as the var I gave
it. For larger lists or more complex objects I might just have an ajax
call for each list change event. It just depends. In either case, you
are simply dealing with individual items that simply need to answer
the predicate found in your 'match' option implementation as to
whether they should be hydrated into the child list or not.
Hope this helps
mike



Hey Mike...James here again.  Now that I've worked through some of the
basics, I would like to know how easy it would be to accommodate a
JSON file in a bit of a more efficient structure using arrays rather
than a simple value pairs.

IE.: You have designed around this structure:

{'when':'selectedValue','value':'itemValue','text':'itemText'}

Whereas after some testing, I've realized the data sizes would become
rather huge rather quickly.

I'm proposing a JSON structure such as:

{

   Country1: [

   {

   Region1: [

   City1,

   City2,

   City3

   ],

   Region2: [

   City1,

   City2,

   City3

   ]

   }

   ]

}

The idea would be for a separate JSON file for each country (now that
we've got dynamic URLs working).  Of course this simplified structure
would require some parsing and reformatting to fit the structure you
have used for the .CASCADE plugin.

My problem is, since I'm so new to all this, I have no idea where in
the code to begin looking at how to take my imported JSON file, and
then do the work on it to change it into your format.

Could you offer some insight on this?

Thanks,

James

On Feb 2, 8:53 am, James james.tilb...@gmail.com wrote:
 @kelly
 Only then I would have to find a way to add some htmlEntitites
 decoding to the whole thing since I am accessing filenames directly...

 On Feb 2, 7:33 am, kellyjandr...@sbcglobal.net

 kellyjandr...@sbcglobal.net wrote:
  You may have to write the special characters with their HTML
  equivalent code. Is that not a possibility?

  On Feb 1, 6:04 pm, James james.tilb...@gmail.com wrote:

   I did attach firebug at one point but couldn't glean anything useful
   from it.  From my google research, the problem has to do with the
   encoding (UTF-8) and JQuery's handling of special characters.  I can't
   explain why IE breaks while Firefox just displays a strange
   character...

   In any case, the solution to this is beyond me.

   For now it looks like I'm going to have to run my data through a
   function to replace accented characters with their normal
   counterparts.

   I'd be interested to hear from others about possible fixes to this
   though...

   On Feb 1, 4:13 pm, Mike Nichols nichols.mik...@gmail.com wrote:

have you attached fiddler and firebug to see what it happening?

On Feb 1, 10:14 am, James james.tilb...@gmail.com wrote:

 ...I must add and point out that the EXACT SAME DATA exists in the
 external file and the inline var.

 So it is ALSO very strange that the accents as mentioned display
 correctly in the first example (pulling from the inline var) and don't
 in the second example (pulling from the external file).

 I guess this helps to isolate where the problem is occuring?  Some
 parsing routine that only applies to externally-read files?

 On Feb 1, 12:10 pm, James james.tilb...@gmail.com wrote:

  Update2:

  The problematic page is still up as promised for discussion 
  purposes,
  but I have a breakthrough to report.

  I never would have suspected this in a million years, but I 
  discovered
  it after following through with my same line of logic regarding the
  JSON data causing a problem.

  I eliminated single quotes and commas from the equation as these
  worked just fine.  However, I thought I would try other characters
  since I noticed that accented characters were showing up strangely 
  in
  the dropdown list (see under Quebec - Gaspé, for an example).  Where
  it should say GASPé, it instead shows GASP(question mark inside a
  diamond).  Firefox displays this, IE doesn't display anything but 
  the
  loading circle graphic.

  I can fix this by replacing all accented characters in my data with
  regular alphabet characters, but the question is - why is this 
  causing
  a problem with the JQuery/IE combination?

  I would much rather leave accented characters intact.  Something in
  the JQuery routines can't handle these characters and/or is 
  replacing
  them with a strange character.

  Any ideas?

  On Feb 1, 11:46 am, James james.tilb...@gmail.com wrote:

   Update:
   It doesn't seem to have anything to do with single quotes or 
   commas,
   for that matter

[jQuery] Re: Cascade (chained) works in Firefox but not in IE

2009-02-01 Thread Mike Nichols

have you attached fiddler and firebug to see what it happening?

On Feb 1, 10:14 am, James james.tilb...@gmail.com wrote:
 ...I must add and point out that the EXACT SAME DATA exists in the
 external file and the inline var.

 So it is ALSO very strange that the accents as mentioned display
 correctly in the first example (pulling from the inline var) and don't
 in the second example (pulling from the external file).

 I guess this helps to isolate where the problem is occuring?  Some
 parsing routine that only applies to externally-read files?

 On Feb 1, 12:10 pm, James james.tilb...@gmail.com wrote:

  Update2:

  The problematic page is still up as promised for discussion purposes,
  but I have a breakthrough to report.

  I never would have suspected this in a million years, but I discovered
  it after following through with my same line of logic regarding the
  JSON data causing a problem.

  I eliminated single quotes and commas from the equation as these
  worked just fine.  However, I thought I would try other characters
  since I noticed that accented characters were showing up strangely in
  the dropdown list (see under Quebec - Gaspé, for an example).  Where
  it should say GASPé, it instead shows GASP(question mark inside a
  diamond).  Firefox displays this, IE doesn't display anything but the
  loading circle graphic.

  I can fix this by replacing all accented characters in my data with
  regular alphabet characters, but the question is - why is this causing
  a problem with the JQuery/IE combination?

  I would much rather leave accented characters intact.  Something in
  the JQuery routines can't handle these characters and/or is replacing
  them with a strange character.

  Any ideas?

  On Feb 1, 11:46 am, James james.tilb...@gmail.com wrote:

   Update:
   It doesn't seem to have anything to do with single quotes or commas,
   for that matter, inside the JSON data.

   Now HERE'S something to make you scratch your head:

   I have now put the complete data file back up in the external file
   ('CANADA_3.js') and I have ALSO put the EXACT same data file into the
   static var included inline in the HTML page ('list3').

   This is the best demonstration of the problem:  The external file and
   the static var both load fine if using Firefox.  Only the static var
   works for IE.

   Live page (will not change until further 
   response):http://jamestilberg.com/jquery/

   James

   ?

   On Feb 1, 11:22 am, James james.tilb...@gmail.com wrote:

@Mike
Thanks.  But it should have been working with the default code since
dropdown 2 was working - dropdown 3 used the exact same principle.
There is definitely something going on different between FF and IE.

Question - Could the existence of single quotes within the JSON data
throw off JQuery?  example: If one of the cities is O'Brien

I ask because I have now put up a refined page with the two methods
and I have used a smaller version of the data file and guess what?  It
now works.  So this leads me to believe the JSON data itself may have
been causing a problem with IE only (Firefox always worked).

   http://jamestilberg.com/jquery/

The thing is, I had already validated the JSON data with several
different online JSON validators

I guess I need to build the JSON file back up and see if something
specific stumps JQuery...

On Feb 1, 2:01 am, Mike Nichols nichols.mik...@gmail.com wrote:

 @James
 Thinking about what you are doing here with the third dropdown...By
 attaching that dropdown to the second you are telling it to be
 filtered by the second dropdown's selected value...which is not
 selected yet since it just loaded so I would presume you shouldn't
 have any data in the third drop down.
 To support this behavior in the past I used the 'event' property of
 the options to define which event actually fires a cascade ( the
 defalt is 'changed'). Then I manually fire cascade within the parent
 element's change handler. :
         //when 'make' is selected...
         $(.seconddropdown)
         .cascade(.firstdropdown,{
                 ajax: 'firsturl.js'
         })
         .bind(change,function() {
                 $(this).trigger(custom.changed);//manually call 
 cascade
         });

         $(.thirddropdown)
         .cascade(.secondbehavior,{
                 event : custom.changed,//bind to custom event to 
 prevent loading
 from cascade
                 ajax: 'secondurl.js',
         });

 On Jan 31, 4:39 pm, James james.tilb...@gmail.com wrote:

  I am new to JQuery and your cascading dropdown was exactly what I 
  was
  looking for.  After formatting my data in JSON I have tested out the
  Chained example (http://dev.chayachronicles.com/jquery/cascade/
  index.html) and it ONLY WORKS in Firefox and NOT IE.

  I am

[jQuery] Re: Cascade (chained) works in Firefox but not in IE

2009-01-31 Thread Mike Nichols

@James
Thinking about what you are doing here with the third dropdown...By
attaching that dropdown to the second you are telling it to be
filtered by the second dropdown's selected value...which is not
selected yet since it just loaded so I would presume you shouldn't
have any data in the third drop down.
To support this behavior in the past I used the 'event' property of
the options to define which event actually fires a cascade ( the
defalt is 'changed'). Then I manually fire cascade within the parent
element's change handler. :
//when 'make' is selected...
$(.seconddropdown)
.cascade(.firstdropdown,{
ajax: 'firsturl.js'
})
.bind(change,function() {
$(this).trigger(custom.changed);//manually call cascade
});


$(.thirddropdown)
.cascade(.secondbehavior,{
event : custom.changed,//bind to custom event to prevent 
loading
from cascade
ajax: 'secondurl.js',
});



On Jan 31, 4:39 pm, James james.tilb...@gmail.com wrote:
 I am new to JQuery and your cascading dropdown was exactly what I was
 looking for.  After formatting my data in JSON I have tested out the
 Chained example (http://dev.chayachronicles.com/jquery/cascade/
 index.html) and it ONLY WORKS in Firefox and NOT IE.

 I am attempting to load the data from two external files, while your
 example loads the second data set from a static var.

 Is there a further step necessary to get this to work in IE?

 I have my working example at:http://jamestilberg.com/jquery/

 Any help would be appreciated!  :)


[jQuery] Re: passing args to a delegate

2008-12-12 Thread Mike Nichols

Try this:
success: function() { registerImageForms(id,key,type); }


On Dec 12, 5:13 pm, Jan Limpens jan.limp...@gmail.com wrote:
 Hello,

 I have the following code:

 var registerImageForms = function(id, key, type) {
     var sizes = ['small', 'medium', 'large'];
     $('#panel-images fieldset:visible').remove();
     $.each(sizes, function(i, item) {
         var $clonedForm = $('#panel-images fieldset:hidden').clone();
         $(legend, $clonedForm).text(item);
         $([name='id'], $clonedForm).val(id);
         $([name='key'], $clonedForm).val(key);
         $([name='type'], $clonedForm).val(type);
         $([name='size'], $clonedForm).val(item);
         $(img, $clonedForm).attr('src', /imagem/article/ + key +
 / + item + .png);
         $(#panel-images).append($clonedForm);
         $(form, $clonedForm).ajaxForm({
             success: registerImageForms
         });
         $clonedForm.show();
     });

 };

 Success has no args, so everything is rendered empty, after posting
 the form. If I pass arguments as
             success: registerImageForms(id, key, type)

 The browser crashes and it makes sense, because at the time this
 fires, these identifiers mean nothing. But how do I pass them?

 --
 Jan


[jQuery] Re: [validate] Allowing letters only in a text input?

2008-11-30 Thread Mike Nichols

Try this:
http://plugins.jquery.com/project/constrain

On Nov 30, 12:54 pm, deronsizemore [EMAIL PROTECTED] wrote:
 Hi! Thanks for the quick reply. So, with this code added, will it make all
 fields letters only or is there a way for me to specify what field(s) I want
 to allow letters only?

 Thanks,
 Deron



 I-CRE8 wrote:

  On Nov 29, 11:06 pm, deronsizemore [EMAIL PROTECTED] wrote:

  The code is as follows:

  jQuery.validator.addMethod(lettersonly, function(value, element) {
          return this.optional(element) || /^[a-z]+$/i.test(value);

  }, Letters only please);

  My problem is that I'm not sure where to place the above code so that I
  can
  require only letters in one of my fields?

  Hi,

  you would please your code something like this:

  script type=text/javascript

  jQuery.validator.addMethod(lettersonly, function(value, element) {
          return this.optional(element) || /^[a-z]+$/i.test(value);

  }, Letters only please);

     $().ready(function() {
             $(#submit).validate({
          errorPlacement: function(error, element) {
               error.insertBefore(element);
           },
                  rules: {
                          name: {
                             required: true,
                             lettersonly: true // assuming you want name
  to be validated with lettersonly

                          },
                          email: {
                                  required: true,
                                  email: true
                          }
                  },
                  messages: {
                          name: Please enter your name,
                          email: {
                                  required: Please enter your email,
                                  email: Please enter a valid email
  address
                          }
                  }
          });

     });
  /script

  Regards,

  Dave Buchholz
  I-CRE8 Internet Solutions
 http://www.i-cre8.co.uk
  Skype: I-CRE8

 --
 View this message in 
 context:http://www.nabble.com/-validate--Allowing-letters-only-in-a-text-inpu...
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Re: asp.net and jquery - reactions to this letter

2008-11-19 Thread Mike Nichols

Probably any complaints would only come from users of the WebForms
model, not asp.net MVC or Monorail. The debugging argument just points
to a need for a better testing setup...unit tests maybe?


[jQuery] Re: AJAX with IE and method POST

2008-11-14 Thread Mike Nichols

did you forget to pass data (data:{}) in the ajax call? I have had
that trip me up when doing posts via ajax.

On Nov 14, 10:35 am, George [EMAIL PROTECTED] wrote:
 Hi guys/girls,
 I just wanted to post here my problems (and solution) I had been
 struggling with last 2 days.

 I was doing JQuery AJAX POST and it was not working in IE wile working
 in FireFox.
 Sometimes you will get 12030 error (Server unexpectedly terminated
 connection) from IE's XMLHttpRequest object.

 I discovered that in order for IE's XMLHttpRequest object to properly
 read return stream the input stream must be completely read by the
 server (even if you are not interested in it).

 Some frameworks do it automatically and some do not. For example
 ASP.NET does not do it automatically.
 I was trying to do POST to .ashx handler and was getting errors.

 So adding this code to my handler fixed the problem.

 System.IO.Stream st = context.Request.InputStream;
         byte []buf = new byte[100];
         while (true)
         {
             int iRead = st.Read(buf, 0, 100);
             if( iRead == 0 )
                 break;
         }
         st.Close();

 So I am just posing it for Google to spider it and people to be able
 to find it. Cause when I googled I found a lot of people having
 problem with 12030 error but no solution.

 Good luck,
 George


[jQuery] Re: Custom sorter/parser for tablesorter

2008-11-11 Thread Mike Nichols

 Yuck, why patch the js file when a custom parser could just be
 built?

IIRC, the custom parser changed from being able to sort as a set to go
an item by item comparison, which eliminated being able to do a
natural sorting algorithm. This is a bit different from Rodent's
requirements but remains a difficulty nonetheless.
How would you propose an custom parser for sorting naturally the
following and retaining this order?

z1.txt
z2.txt
z9.txt
z10.txt
z11.txt
z12.txt
z20.txt
z100.txt




On Nov 11, 7:37 am, MorningZ [EMAIL PROTECTED] wrote:
 Here's an example if my question above is answered by yes, that's
 correct

 http://paste.pocoo.org/show/90863/

 Remove the console.log if you aren't using FireFox and Firebug
 (which you should be as a JavaScript developer!)

 On Nov 11, 8:33 am, MorningZ [EMAIL PROTECTED] wrote:

  Yuck, why patch the js file when a custom parser could just be
  built?

  before that can happen though, something needs to be made more clear

  in the examples above, you pretty much are just ignoring letters for
  sorting purposes?

  On Nov 11, 2:51 am, Rodent of Unusual Size [EMAIL PROTECTED] wrote:

   On Nov 11, 12:29 am, Mike Nichols [EMAIL PROTECTED] wrote:

I submitted a patch a long time ago to do this that implemented a
natural sorting algorithm for this but it would never get applied and
I couldn't get a response..I assumed the project was light or dead.
I can send you the patched .js i had if you like.

   Sure.  To what file(s) is it a patch, and does it still apply?

   Thanks!


[jQuery] Re: Custom sorter/parser for tablesorter

2008-11-10 Thread Mike Nichols

I submitted a patch a long time ago to do this that implemented a
natural sorting algorithm for this but it would never get applied and
I couldn't get a response..I assumed the project was light or dead.
I can send you the patched .js i had if you like.


On Nov 10, 9:56 pm, Rodent of Unusual Size [EMAIL PROTECTED] wrote:
 I'm just discovering jQuery and finding it really interesting.
 Usual sort of 'learn by doing' thing.  I've been playing with
 the tablesorter plugin, but I've run into a wall.  Particularly
 since I'm far from expert in Javascript. :-)

 I want to be able to sort a table on a column containing
 integrated circuit numbers (such as 7400, LM555, 74LS50
 4026, et cetera).  I want the technology (i.e., the 'LS'
 in '74LS50') to be ignored for sorting purposes, so 74LS50
 and 74H50 would be juxtaposed.  I also want the series
 to be grouped together (e.g., 7400 series together,
 4000 series together, et cetera).

 Unfortunately, this is possibly a little more complex than
 it might seem.  Given the following part numbers,

 7400
 4010
 74C10
 4026
 74257
 4012
 74LS174
 40257

 the correct ascending order should be

 4010
 4012
 4026
 40257
 7400
 74C10
 74LS174
 74257

 I'm used to custom sorting callbacks that are given two arguments
 and return whether ab, a==b, or ab -- but I'm not finding how
 to do the equivalent with tablesorter.

 Is it even possible?

 Thanks!
 --
 #ken    P-)}

 Ken Coar, Sanagendamgagwedweinini  http://Ken.Coar.Org/
 Author, developer, opinionist      http://Apache-Server.Com/

 Millennium hand and shrimp!


[jQuery] Re: Add callback to plugin?

2008-11-06 Thread Mike Nichols

Why not take advantage of jquery's event mechanism and do an event
based api, like:
$(#sel).testStatus(opt).bind(statusupdated.testStatus,function()
{
  //dostuff
});

then in your plugin:

if (question) {
  $.ajax({
type: 'POST',
url: itemHref + defaults.status
  });
  $(this).trigger(statusupdated.testStatus);
}


On Nov 6, 9:37 pm, Hector Virgen [EMAIL PROTECTED] wrote:
 I would add it as an option and set its default value to an empty function:
 var defaults = {
     status: '?action=live',
     onComplete: function() {}

 }

 That way you could safely call onComplete when ready and it will either do
 nothing or call the user-supplied function.

 -Hector

 On Thu, Nov 6, 2008 at 8:33 PM, Nic Hubbard [EMAIL PROTECTED] wrote:

  What is the best way to add a callback to a plugin that I wrote?  Do I
  just add it as an additional option?

  So, after the ajax function is run, how would I allow a custom
  callback or function to be added by the user?

   $.fn.testStatus = function(options) {
     var defaults = {
       status: '?action=live'
     };

     var options = $.extend(defaults, options);

     return this.each(function() {

       var obj = $(this);
       var itemId = obj.attr('id');
       var itemHref = obj.attr('href');
       obj.click(function() {
         var question = confirm('Are you sure you want change the
  status?');
         if (question) {
           $.ajax({
             type: 'POST',
             url: itemHref + defaults.status
           });
         }
         return false;
       });
     });
   };


[jQuery] Re: jquery.validate cascade/chained selects

2008-11-02 Thread Mike Nichols

Are you using the cascade plugin?

On Oct 15, 1:47 pm, Migue [EMAIL PROTECTED] wrote:
 Hi, im trying to use jquery.validate plugin in a form with  cascade/
 chained ajax selects.
 Thatcascadeloading was bind to select's Change event. But now i have
 conflicts with jquery.validate, i think it overwrites them...

 Any idea?


[jQuery] Re: cascade question

2008-09-23 Thread Mike Nichols

Sorry I missed this.
I do the same thing ricardo recommended when unable to load the values
from the server on load.

On Sep 18, 12:23 pm, ricardobeat [EMAIL PROTECTED] wrote:
 oops, I didn't pay attention.

 You need to set the selected attribute and then fire the 'change'
 event on the parent select to which the 'cascade' funcionality is
 bounded by default.

 $('#first [value=B]').attr('selected','selected').parent().change()

 ricardo

 On Sep 18, 4:14 am, kevin [EMAIL PROTECTED] wrote:

  Hi ricardo,

  i tried this before,but set option attribute can only let first box
  selected on B
  it won't trigger second box get data from database.
  second box won't change until you click on the first box and select
  other options

  all i want is first box selected on B and second box selected on
  B2 automatically when page loaded.

  i still added  selected=selected  on option B.
  here is the sample pagehttp://sskes.damimi.org/test/

  thanks anyway.

  On 9月18日, 上午6時32分, ricardobeat [EMAIL PROTECTED] wrote:

   You can do it via XHTML:

   option value=B selected=selectedB/option

   or add the attribute with jQuery:

   $('#first option:eq(2)').attr('selected','selected');

   ricardo

   On Sep 17, 10:50 am, kevin [EMAIL PROTECTED] wrote:

Hi all,

here is my sample page  http://sskes.damimi.org/test/

my question is how can i let the first box selected on B and also
trigger second box list the correct value
B1,B2,B3,B4 automatically when page loaded.

thanks.


[jQuery] Re: $.post callback problem

2008-09-11 Thread Mike Nichols

I've had problems with not specifiying the 'data' to be sent to the
server on a post ,ie:
$.post(url,{data:{}});

You might try that and see if it fixes it


On Sep 11, 3:32 pm, Mike Alsup [EMAIL PROTECTED] wrote:
  i am trying to use data i am getting back from $.post but I am not
  able to get the function with the data in it to work

  $(a.rater).click(function(event)
          {
                  $.post($(this).attr(href)),
                          function(data)
                          {
                     update = data.split('|');
                    $('#'update[0]).replaceWith(update[1]);
                          };
                  return false;
          }
  );

 What does Firebug report that the response from the post is?


[jQuery] Re: [validate] metadata bug

2008-09-10 Thread Mike Nichols

Done...this is at http://dev.jquery.com/ticket/3356#preview


On Sep 9, 6:46 am, Jörn Zaefferer [EMAIL PROTECTED]
wrote:
 Could you file a ticket for this?http://dev.jquery.com/newticket

 Thanks
 Jörn

 On Tue, Sep 9, 2008 at 3:22 PM, Mike Nichols [EMAIL PROTECTED] wrote:

  If this is in a form:
  input class=required type=text/

  and the form is validated with:
  jQuery(#demo_form).validate({meta:validate}); // inside $.ready

  Then I get this :
  meta is undefined
  file:///C:/Development/Assets/test/datetime/jquery.validate.js
  Line 507

  Which is caused by this:
  return meta.messages  meta.messages[method];

  I think this is a new function in the 1.4 script but I think it should
  check for !meta before calling 'meta.messages' :

  if(!meta){   return; }

  This fixes thebug

  Mike


[jQuery] [validate] metadata bug

2008-09-09 Thread Mike Nichols

If this is in a form:
input class=required type=text/

and the form is validated with:
jQuery(#demo_form).validate({meta:validate}); // inside $.ready

Then I get this :
meta is undefined
file:///C:/Development/Assets/test/datetime/jquery.validate.js
Line 507

Which is caused by this:
return meta.messages  meta.messages[method];

I think this is a new function in the 1.4 script but I think it should
check for !meta before calling 'meta.messages' :

if(!meta){   return; }

This fixes the bug

Mike



[jQuery] [validate] delayed validation

2008-09-08 Thread Mike Nichols

Hi
I have a text field which is evaluated on its onblur event and
corrected by inserting the default year. So I might enter '0508' and
it will convert to '05/08/2008' onblur.

The validate plugin is evaluating the field's value before my plugin
can change it so it says 'Please enter a valid date', as '0508' isn't
a valid date.

I do have my plugin binding to the onblur event before validate
(appears first in $.ready) so I am wondering if there is a recommended
approach for something like this?

Thank you
Mike


[jQuery] Re: Proof of concept: Animated data grid/table jquery plugin with sorting and pagination and somewhat lightweight

2008-09-02 Thread Mike Nichols

sweet...i implemented natural sorting in tablesorter but it never got
put in so I am thrilled to see it baked into your implementation...
looks good
mike

On Sep 1, 11:09 pm, Alexandre Plennevaux [EMAIL PROTECTED]
wrote:
 very nice indeed !

 1/ when going to the last page, the table height adapts to the number of
 rows. It would be better that the table height does not vary i think
 2/ What's the maximum amount of rows do you think it is safe to work with? I
 suppose beyond a certain level, the table will feel unresponsive

 thanks for sharing !

 Alexandre Plennevaux
 LAb[au]

 http://www.lab-au.com

 On Tue, Sep 2, 2008 at 2:09 AM, num [EMAIL PROTECTED] wrote:

  My proof of concept

 http://www.overset.com/2008/08/30/animated-sortable-datagrid-jquery-p...

  I haven't yet seen html scrolling animation like this non-flash or
  flex. This is essentially an unreleased jquery plugin that you can
  attach to an already created table that will allow for sorting and
  pagination. The animation is sensitive to the page delta, i.e. it will
  scroll faster if you go from page 1 to 5 than from page 1 to 2. The
  core of the animation is really a queued style.display: ( 'none' ||
  '' ) and given the delay by hijacking the .animate() functionality as
  many have used in the past. It feels somewhat dirty but is easier than
  programming another whole setTimeout management layer for this.

  I put a bit of work on coding an intelligent sort that is similar to
  php's old natural sort (STRING_SORT) and is faster (as of some initial
  testing) than other implementations I've seen.

  I'm going to re-vamp the re-drawing of the table rows to make this
  faster considering how slow it currently is.. but the animation of the
  pagination is something I wanted to throw out there for some feedback.

  It's currently floating around 10KB un-minified and well commented

  Cheers


[jQuery] Re: cascade plugin targeted to $(this)

2008-08-20 Thread Mike Nichols

I just updated the demo page at http://dev.chayachronicles.com/jquery/cascade/

At the bottom is an example of siblings being registered that are
within containers within a table.
The selectors could be cleaned up but it works for now...have a look
and let me know how that works for you.
One thing I'd point out is that you are using the same id multiple
times which is invalid html so that will choke any jquery selectors.
I'd recommend selecting by class in your markup instead of ids.
mike

On Aug 20, 12:46 am, pervak [EMAIL PROTECTED] wrote:
 Sorry I mean

 jQuery(div#resort_select select,this).cascade(div#country_sel
 select,{

 and

 jQuery(div#resort_select select,this).cascade(this,div#country_sel
 select,{

 On Aug 19, 7:38 pm, Mike Nichols [EMAIL PROTECTED] wrote:

  what is div#kurort_select ?
  I can't find that in your markup.

  On Aug 19, 5:58 am, pervak [EMAIL PROTECTED] wrote:

   Hi all!

    I've tried to usecascadeplugin from Mike Nichols and everything
   goes fine until i need to adjust it for the several dropdowns.

   [code]
   td class=tdg id=a_g_s

           div class=all_geo_select
               div id=country_sel
               Countrybr /
   select name=country_id[]
   option value=0Select the country/option
   option value=1Austria/option
   option value=2Bali/option
   /select
               /div

               div id=resort_select
               Resortbr /
   select name=resort_id[]
   option value=0Select resort/option
   option value=4Bad Blumau/option
   /select
                   /div

           /div    !-- all geo 1 --

    div class=all_geo_select
               div id=country_sel
               Countrybr /
   select name=country_id[]
   option value=0Select the country/option
   option value=1Austria/option
   option value=2Bali/option
   /select
               /div

               div id=resort_select
               Resortbr /
   select name=resort_id[]
   option value=0Select resort/option
   option value=4Bad Blumau/option
   /select
                   /div

           /div    !-- all geo 2 --
   /td
   [/code]

   I need that each Country drop down affects only on it's Resort drop
   down.

   I write this code:

   jQuery(document).ready(function() {
           jQuery(td#a_g_s div.all_geo_select).each(function(i){

           jQuery(div#kurort_select select,this).cascade(div#country_sel
   select,{
                                                           ajax: {
                                                                   url: 
   'countries_ajax.js',
                                                                   data: { 
   myotherdata: jQuery(#ajax_header).html() }
                                                           },
                                                           template: 
   commonTemplate,
                                                           match: commonMatch
                   });

       }); // each

   });

   When I change the first div's Country it affects on both Resort drop
   downs (but changing the second div's Country affects nothing!).

   If I write

   jQuery(div#kurort_select select,this).cascade(this,div#country_sel
   select,{

   It affects on each drop down but the options become empty.

   Help please to say THIS tocascadeplugin.

   Thanks in advance, Alexander.


[jQuery] Re: cascade plugin targeted to $(this)

2008-08-19 Thread Mike Nichols

what is div#kurort_select ?
I can't find that in your markup.


On Aug 19, 5:58 am, pervak [EMAIL PROTECTED] wrote:
 Hi all!

  I've tried to use cascade plugin from Mike Nichols and everything
 goes fine until i need to adjust it for the several dropdowns.

 [code]
 td class=tdg id=a_g_s

         div class=all_geo_select
             div id=country_sel
             Countrybr /
 select name=country_id[]
 option value=0Select the country/option
 option value=1Austria/option
 option value=2Bali/option
 /select
             /div

             div id=resort_select
             Resortbr /
 select name=resort_id[]
 option value=0Select resort/option
 option value=4Bad Blumau/option
 /select
                 /div

         /div    !-- all geo 1 --

  div class=all_geo_select
             div id=country_sel
             Countrybr /
 select name=country_id[]
 option value=0Select the country/option
 option value=1Austria/option
 option value=2Bali/option
 /select
             /div

             div id=resort_select
             Resortbr /
 select name=resort_id[]
 option value=0Select resort/option
 option value=4Bad Blumau/option
 /select
                 /div

         /div    !-- all geo 2 --
 /td
 [/code]

 I need that each Country drop down affects only on it's Resort drop
 down.

 I write this code:

 jQuery(document).ready(function() {
         jQuery(td#a_g_s div.all_geo_select).each(function(i){

         jQuery(div#kurort_select select,this).cascade(div#country_sel
 select,{
                                                         ajax: {
                                                                 url: 
 'countries_ajax.js',
                                                                 data: { 
 myotherdata: jQuery(#ajax_header).html() }
                                                         },
                                                         template: 
 commonTemplate,
                                                         match: commonMatch
                 });

     }); // each

 });

 When I change the first div's Country it affects on both Resort drop
 downs (but changing the second div's Country affects nothing!).

 If I write

 jQuery(div#kurort_select select,this).cascade(this,div#country_sel
 select,{

 It affects on each drop down but the options become empty.

 Help please to say THIS to cascade plugin.

 Thanks in advance, Alexander.


[jQuery] Announcing Cascade plugin

2008-07-20 Thread Mike Nichols

Hi all,
I have had this plugin in use for a while and it is ready for the
wild. This plugin originally was conceived to simply handle the
canonical cascade requirement of select elements filtering other
select element options, but has grown to deal with any similar
behavior requirement .

A demo has just been put out on 
http://dev.chayachronicles.com/jquery/cascade/index.html
and the project page is at http://plugins.jquery.com/project/cascade .

If there are any suggestions or requests, please let me know.
Mike


[jQuery] ajax response content type interception

2008-07-18 Thread Mike Nichols

I submitted a patch a long time ago here http://dev.jquery.com/ticket/2890
that allows the response content type to determine how jquery handles
the response (script, html, etc).
This is not being looked at or applied (not sure why) so I was
wondering if there is a way to intercept the response to change the
'dataType' property with some kind of listener so that I won't have to
keep maintaining a modified jquery.js ?

Any ideas on how to alter jquery's handling of the responseText on a
success ? I believe the 'success' callback would be too late in the
lifetime.
mike


[jQuery] Re: Autocomplete: Multi-dim JSON array and Custom format

2008-06-18 Thread Mike Nichols

I Have an plugin called 'cascade' that does this using templating very
easily here http://plugins.jquery.com/project/cascade or consider the
very lightweight autocomplete here 
http://plugins.jquery.com/project/jq-autocomplete
which also uses the templating plugin.
I hopped to this autocomplete for this kind of flexibility and
scalability.

On Jun 17, 11:07 pm, Shawn [EMAIL PROTECTED] wrote:
 Check out the result method the autocomplete makes available:

 http://docs.jquery.com/Plugins/Autocomplete/result#handler

 The data parameter represents the raw data array.

 OR, you may need to set up the formatResult parameter when
 initializing the autocomplete (or via the setOptions() method).

 http://docs.jquery.com/Plugins/Autocomplete/autocomplete#url_or_datao...http://docs.jquery.com/Plugins/Autocomplete

 I believe the formatResult method would probably be what you are looking
 for, though it's been a while since I used autocomplete and don't fully
 understand your app.. :)

 Hope that helps.

 Shawn

 Adam wrote:
  Ok, that's a great article but not exactly what I need. I don't need
  to modify the results of the select (yet) but I need to modify the
  output of the results: a mulit-dimensional array that would need to be
  looped and shown. It might require a whole script entirely, but
  there's just too much good stuff in Jorn's plugin that I could never
  do on my own.

  On Jun 17, 2:59 pm, Shawn [EMAIL PROTECTED] wrote:
  Which autocomplete are you using?  Which version?

  Not meaning to do a shameless plug, but I wrote a blog article that
  covered using database IDs with Jorn's autocomplete.

 http://grover.open2space.com/node/190

  This was back in December, so might be a little dated.  But I believe
  what you are trying to do seems relatively similar.  Perhaps that might
  help?

  Shawn

  Adam wrote:
  Tried to post this question once before but didn't seem to work...
  I'm needing to get a multi-dim JSON array to work for my autocomplete,
  in an effort to mimic the Spotlight design.
  My JSON currently looks like this:
  [
  {key:names, values:[ bunch of values]},
  {key:emails,values: [ bunch of email values ]}
  ]
  I am wanting to put into an HTML structure like this:
  dl
  dtNames/dt
  dda href=#name/dd
  dda href=#name/dd
  dtEmails/dt
  dda href=#email/dd
  dda href=#email/dd
  /dl
  Basically, I want my JS to loop through the JSON array and spit out
  the key into a dt tag, then each item into a dd. Easier said than
  done.
  Can anyone give me some direction? I've got it as far as listing all
  the names and emails in dd's, but no dt's are happening...
  Here is my adapted autocomplete.js code:
     function parse(data) {
             var parsed = [];
             $(data).each( function() {
                     var rows = this.values;
                     for (var i=0; i  rows.length; i++) {
                             var row = rows[i];
                             if (row) {
                                     row = row.split(|);
                                     parsed[parsed.length] = {
                                             data: row,
                                             value: row[0],
                                             result: options.formatResult 
   options.formatResult(row,
  row[0]) || row[0]
                                     };
                             }
                     }
             });
             return parsed;
     };
  Thanks.


[jQuery] Re: [validate] bug

2008-05-27 Thread Mike Nichols

Hm...sorry I guess I don't follow. The bug/patch I was talking about
was that if you set 'onsubmit=false' on the validate plugin the
'submitHandler' isn't called and so breaks ajax functionality...I am
not sure how the latest jquery release fixes this since the validate
code hasn't accomodated this scenario. Not sure what I'm missing.

On May 26, 3:42 pm, Jörn Zaefferer [EMAIL PROTECTED]
wrote:
 Please just update to jQuery 1.2.6.

 Jörn

 On Mon, May 26, 2008 at 7:59 PM, Mike Nichols [EMAIL PROTECTED] wrote:

  Thanks Jörn,
  Does this mean I need to resubmit the patch to dev.jquery.com then?
  I'd be happy to do so as it fixes a showstopperbug.

  Mike

  On May 23, 1:41 am, Jörn Zaefferer [EMAIL PROTECTED]
  wrote:
  I'm currently wait for the result of the discussion about the change
  to attr. It looks like the 1.2.5 behaviour is intended - once that is
  settled, I'll update the validationpluginaccordingly and release
  1.3.1.

  About patches: I'd like to close down the issue part on
  plugins.jquery.com and stick with dev.jquery.com only. That didn't
  quite work out so far. Posting to this list of jquery-dev about open
  issues as a reminder definitely helps.

  Jörn

  On Thu, May 22, 2008 at 7:16 PM, Mike Nichols [EMAIL PROTECTED] wrote:

   There needs to be a check for value !== null in the attributeRules
   method of the jquery.validateplugin. It bombs otherwise when
   collecting the rules . Not sure if this is because of using the 1.2.5
   jq release.
   Also I have a patch herehttp://plugins.jquery.com/node/1667thatis
   three months old...do I need to submit this somewhere else to be
   considered? This patch lets forms get submitted via Formpluginwhen
   onsubmit='false'

   Thanks in advance!
   Mike


[jQuery] Re: growl for jquery

2008-05-23 Thread Mike Nichols

Maybe this could help
http://www.stanlemon.net/projects/jgrowl.html

On May 22, 8:12 pm, zoul0813 [EMAIL PROTECTED] wrote:
 darren,

 I'll look into adding that functionality -- I just recently got a mac
 again, I wrote the jQuery Growl plugin because I was inspired by the
 MooTools version called Window.Growl ... now that I have a Mac with
 Growl, I'll look into making it more 'Growl like' ... I was also
 experimenting with the idea of making it 'growlStyle-aware' ... so you
 could point it to a .growlStyle directory and it could load up the
 plist and other such data behind the scenes and automatically 'theme'
 your messages ... would require much more code, and lots of requests
 to the server before it was ready ... but it's more of a 'geeky
 feature' then anything else (probably another plugin, to exist -with-
 jQuery Growl).


[jQuery] Re: Some problem with latest version of Jquery Validator?

2008-05-22 Thread Mike Nichols

You need to include a check for value !== null in attributeRules
method...I'd submit a patch but not sure where to do it to have it
considered.
mike

On May 22, 6:28 am, Deep Ganatra [EMAIL PROTECTED] wrote:
 Hi,
 I just downloaded Jquery validator verison: 1.3 (I am using JQuery
 1.25)

 With the latest version following things doesn't work:

 1. Form gets submitted without getting validated
 2. After entering invalid value, when we change the focus of the
 field, instead of showing the error, it throws following JS error.

 -
 val has no properties
 if (val.param || val.depends) {
 -

 Line No. 785.

 When I try the same thing with version 1.2.1 of validator, things work
 fine.

 Do let me know if you want me to post the code.

 Regards,
 Deep


[jQuery] [validate] bug

2008-05-22 Thread Mike Nichols

There needs to be a check for value !== null in the attributeRules
method of the jquery.validate plugin. It bombs otherwise when
collecting the rules . Not sure if this is because of using the 1.2.5
jq release.
Also I have a patch here http://plugins.jquery.com/node/1667 that is
three months old...do I need to submit this somewhere else to be
considered? This patch lets forms get submitted via Form plugin when
onsubmit='false'

Thanks in advance!
Mike


[jQuery] Validate plugin bug

2008-05-22 Thread Mike Nichols

Sorry for the double posting, but the other subject was vague...

There needs to be a check for value !== null in the attributeRules
method of the jquery.validate plugin. It bombs otherwise when
collecting the rules . Not sure if this is because of using the 1.2.5
jq release.
Also I have a patch here http://plugins.jquery.com/node/1667 that is
three months old...do I need to submit this somewhere else to be
considered? This patch lets forms get submitted via Form plugin when
onsubmit='false'

Thanks in advance!
Mike


[jQuery] Re: Dynamically add datepicker

2008-05-22 Thread Mike Nichols

look at the livequery or listen plugins to handle this

On May 22, 1:39 pm, Adam [EMAIL PROTECTED] wrote:
 I'm having trouble dynamically adding both Kelvin Luck's and the UI
 datepicker to a page. I have one working fine when the page loads, but
 bringing one in via an AJAX call doesn't seem to work.

 Anyone have time to troubleshoot this one? I've emailed Kelvin to no
 avail.


[jQuery] Re: Anyone have trouble viewing this site on Vista?

2008-04-17 Thread Mike Nichols

looks fine on my machine

On Apr 16, 12:02 pm, Rick Faircloth [EMAIL PROTECTED]
wrote:
 Hi, all..

 I was attempting to demo this site and show off
 the Cycle plug-in to a prospective client, but the
 Cycle plug-in was acting very strangly... flickering, not
 showing images, etc.

 The other plug-ins were working properly.

 The client's laptop runs Vista.

 Anyone with Vista care to look at this site and check out
 the large photos under the menu and see if they crossfade?

 http://c21ar.wsm-dev.com

 Thanks!

 Rick