[jQuery] Re: Invalid Argument in IE7/8

2009-03-14 Thread Nic Hubbard

Anyone?

I still can't figure out why jScroll Pane is causing the Invalid
Argument.

On Mar 13, 9:38 am, Henry  wrote:
> Nic Hubbard wrote:
> > Ok, I removed all instances of the cycle plugin when it is
> > not needed.  But, this has not fixed the problem in IE7/8.
>
> > Why would it be saying that jQuery.js is the file with the
> > problem?
>
> IE browser throw an "invalid argument" error when attempts are made to
> apply nonsensical values to CSS style properties, such as an attempt
> to set a width or height to a negative value.  If that sort of thing
> is the cause of your error then it is happening in the jQuery file
> because that is where the property is actually being set, but the real
> error will be wherever the nonsensical value is passed as an argument
> to the jQuery function/method call.


[jQuery] Re: Need example of dynamic validation

2009-03-14 Thread Rick Faircloth

I'm not familiar enough with it to validate it for you, but
I'd like to know if it's working for you...

Rick

> -Original Message-
> From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
> Behalf Of Loony2nz
> Sent: Saturday, March 14, 2009 6:08 PM
> To: jQuery (English)
> Subject: [jQuery] Re: Need example of dynamic validation
> 
> 
> I think I got it.. can someone validate this for me..see if I'm on the
> right track?
> 
> rules: {
> regType: {required: true},
> first_name: {required:true},
> last_name: {required:true},
> individual_state: {
>   required: function(element) {
>   return $('input[name=regType]:checked').val() == 'Individual'
>   }
> },
> business_state: {
>   required: function(element) {
>   return $('input[name=regType]:checked').val() != 'Individual'
>   }
> }
> 
> Thanks!
> 
> 
> On Mar 14, 2:55 pm, Loony2nz  wrote:
> > validation.
> >
> > basically if they choose individual, show the individual section of
> > the form and make those fields validate (address, city, state, zip
> all
> > required).
> > but if they choose business don't make the individual section
> > required.
> >
> > i'm lost how to do this logic in the jQuery validation plug in..
> >
> > thanx for your response.
> >
> > On Mar 14, 2:46 pm, "Rick Faircloth" 
> wrote:
> >
> > > Is it "validation" you need, or just something to respond to their
> > > choice in order to set up your page accordingly?
> >
> > > > -Original Message-
> > > > From: jquery-en@googlegroups.com [mailto:jquery-
> e...@googlegroups.com] On
> > > > Behalf Of Loony2nz
> > > > Sent: Saturday, March 14, 2009 5:31 PM
> > > > To: jQuery (English)
> > > > Subject: [jQuery] [validate] Need example of dynamic validation
> >
> > > > Hi all,
> >
> > > > I need an example for this situation:
> >
> > > > I have a form that dynamically shows different parts of the form
> based
> > > > on radio button choices.
> >
> > > > Example:  Registrion type:  Business or Individual radio buttons
> >
> > > > If they click on Business, I have a portion of the page only show
> > > > business information fields.
> > > > If they click on Individual, I have another portion of the page
> only
> > > > show individual information fields.
> >
> > > > How can I validate, say, "business_state" or "individual_state"
> based
> > > > on the radio button choice?
> >
> > > > If I put in validation in the function for both fields, I get no
> > > > validation and the form passes.  But, if I put in one or the
> other
> > > > validation the form does the validation and doesn't pass.
> >
> > > > help :(
> >
> > > > Thanks!
> >
> > > > No virus found in this incoming message.
> > > > Checked by AVG -www.avg.com
> > > > Version: 8.5.278 / Virus Database: 270.11.12/1998 - Release Date:
> > > > 03/14/09 06:54:00
> 
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 8.5.278 / Virus Database: 270.11.12/1998 - Release Date:
> 03/14/09 06:54:00



[jQuery] Re: [validate] Need example of dynamic validation

2009-03-14 Thread Rick Faircloth

I don't use the plug-in typically, but may start soon.  I've been
rolling my own validation routines.

However, is it possible to set up two separate validation routines
with the plug-in with separate id's or some other identifier and
call the appropriate routine according to the user's selection?

It would certainly seem easier to do that rather than trying to
manipulate a single validation routine to cater to two separate forms.

Rick

> -Original Message-
> From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
> Behalf Of Loony2nz
> Sent: Saturday, March 14, 2009 5:55 PM
> To: jQuery (English)
> Subject: [jQuery] Re: [validate] Need example of dynamic validation
> 
> 
> validation.
> 
> basically if they choose individual, show the individual section of
> the form and make those fields validate (address, city, state, zip all
> required).
> but if they choose business don't make the individual section
> required.
> 
> i'm lost how to do this logic in the jQuery validation plug in..
> 
> thanx for your response.
> 
> On Mar 14, 2:46 pm, "Rick Faircloth"  wrote:
> > Is it "validation" you need, or just something to respond to their
> > choice in order to set up your page accordingly?
> >
> > > -Original Message-
> > > From: jquery-en@googlegroups.com [mailto:jquery-
> e...@googlegroups.com] On
> > > Behalf Of Loony2nz
> > > Sent: Saturday, March 14, 2009 5:31 PM
> > > To: jQuery (English)
> > > Subject: [jQuery] [validate] Need example of dynamic validation
> >
> > > Hi all,
> >
> > > I need an example for this situation:
> >
> > > I have a form that dynamically shows different parts of the form
> based
> > > on radio button choices.
> >
> > > Example:  Registrion type:  Business or Individual radio buttons
> >
> > > If they click on Business, I have a portion of the page only show
> > > business information fields.
> > > If they click on Individual, I have another portion of the page
> only
> > > show individual information fields.
> >
> > > How can I validate, say, "business_state" or "individual_state"
> based
> > > on the radio button choice?
> >
> > > If I put in validation in the function for both fields, I get no
> > > validation and the form passes.  But, if I put in one or the other
> > > validation the form does the validation and doesn't pass.
> >
> > > help :(
> >
> > > Thanks!
> >
> > > No virus found in this incoming message.
> > > Checked by AVG -www.avg.com
> > > Version: 8.5.278 / Virus Database: 270.11.12/1998 - Release Date:
> > > 03/14/09 06:54:00
> 
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 8.5.278 / Virus Database: 270.11.12/1998 - Release Date:
> 03/14/09 06:54:00



[jQuery] Re: Executing javascript that comes inside an AJAX response

2009-03-14 Thread NightWatchman

To execute javascript code returned by the server you need to use the
javascript eval function on the string of script returned from the
server. As far as I know changing the content of a div to a javascript
block won't cause that javascript code to execute.

I think you need to change:

contentDiv.innerHTML = data;

to

eval(data);

On Mar 14, 3:12 pm, Foreigner  wrote:
> Hi,
> I'm trying to use jQuery to get some HTML with Javascript using AJAX.
> My response gets inserted into the contentDiv element but my
> javascript inside the response doesn't get executed as the
> documentation says (http://docs.jquery.com/
> Specifying_the_Data_Type_for_AJAX_Requests).
>
> Here goes my function with AJAX call:
>
> function loadHtml(obj)
> {
>         if(obj.className == "menuItem")
>         {
>                 $.ajax({
>                                  type:"GET",
>                                  url:"content/" + obj.id + ".html",
>                                  dataType: "html",
>                                  success:
>                                          function(data, status)
>                                          {
>                                                   contentDiv.innerHTML = data;
>                                          }
>                                 });
>         }
>
> }
>
> My response looks like:
>
> Some heading
> 
>
> //Some javascript code
>
> 


[jQuery] Re: Form plugin ajax file upload works in Firefox but not IE

2009-03-14 Thread Mike Alsup

> I was on v2.18 (still the latest rev listed on the jquery.com site).  I
> downloaded v2.24 and the problem is gone.
>
> Thanks for the quick response though!


Glad to hear it.  Thanks for letting me know.


[jQuery] Re: help with menu and show/hide divs

2009-03-14 Thread kevinm

Thank for the solutions.

Yeah I almost went old school, for sanity. In the, before I saw this
post I did something with filter and find. But I may use your's, Adam
that is more streamlined. Will have to try and see what happens

On Mar 14, 9:09 am, "Adam Jessop"  wrote:
> Do something like:
>
> 
> first
> second
> third
> 
>
> 
>     
>          
>         
>         
>     
> 
>
> JS:
>
> $(function(ev) {
>
>         $('#links a').click(function(ev){
>                 $('#content div').hide();
>                 id = $(this).attr('id');
>                 $('#' + id + 'Div').show();
>         );
>
> });
>
> Untested but you get the idea :)
>
> -Original Message-
> From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
>
> Behalf Of Paul Hutson
> Sent: 14 March 2009 11:44
> To: jQuery (English)
> Subject: [jQuery] Re: help with menu and show/hide divs
>
> Kevin,
>
> You could always go back to basics... i.e. the following (you'll have
> to use your existing hide show code..) - and I know this isn't
> elegant...
>
>     if (ClickedItem == "firstdiv")
>     {
>         ShowFirstDiv;
>         HideSecondDiv;
>         HideThirdDiv;
>     } elseif (ClickedItem == "firstdiv") {
>         HideFirstDiv;
>         ShowSecondDiv;
>         HideThirdDiv;
>     } else {
>         HideFirstDiv;
>         HideSecondDiv;
>         ShowThirdDiv;
>     };
>
> Regards,
> Paul
>
> On Mar 14, 4:02 am, kevinm  wrote:
> > I know I am doing something stupid , but can't figure it out.
>
> > I have a menu of three items
>
> > first
> > second
> > third
>
> > I then have 3 divs
>
> > 
> >     
> >           
> >          

[jQuery] Re: test for .is(":visible") fails in Safari

2009-03-14 Thread ricardobeat

Try this:

el.find("#pic")
.attr({"src": pix[imgName].imgSrc, "name": imgName})
.bind('load readystatechange', function(e){
   if (this.complete || (this.readyState == 'complete' && e.type =
'readystatechange')) {
el.fadeIn("slow");
   $("#loading").hide();
   };
});

The onload event for images is a cross-browser mess.

- ricardo

On Mar 14, 7:27 pm, Jon Crump  wrote:
> Dear all,
>
> OK, solved it myself in case anyone's still listening. It still remains a
> puzzle why safari on Mac interprets the code differently.
>
> The if/else test below isn't necessary. The fadeOut was executing, but the
> .load() callback failed when the .thumb clicked was the same one as the
> previous click. Both FF and IE didn't blink when the src of #pic remained
> the same, but safari wouldn't execute the .load callback because nothing
> loaded: the src of #pic remained the same.
>
> The solution for my purposes was to set the src of #pic to null and then
> re-set it to pix[imgName].imgSrc whatever it might be, then .load() sees
> that something has loaded and executes the callback.
>
> Is this a known discrepancy between how FF, IE, and Safari interpret
> .load(), or something completely screwy and idiosyncratic to my klugy
> code? (jQuery 1.2.6, by the way, in safari 3.1.2)
>
> Jon
>
> On Fri, 13 Mar 2009, Jon Crump wrote:
>
> > Dear all,
>
> > I'm not sure if this is a jQuery question or not, but I got the following
> > code to work in FF, but it fails in Safari:
>
> > $(".thumb").click(function() {
> >    var imgName = $(this).attr("alt");
> >    var el = $("#dropdown");
> >    if (el.is(":visible") && $("#pic").attr("name") == imgName) return;
> >    else {
> >        el.fadeOut("slow", function() {
> >            $("#loading").show();
>
> >            el.find("#textContent")
> >            .text(pix[imgName].aText);
>
> >            el.find("#pic")
> >            .attr({"src": pix[imgName].imgSrc, "name": imgName})
> >            .load(function(){
> >                el.fadeIn("slow");
> >                $("#loading").hide();
> >            });
> >        });
> >    }
> > });
>
> > The if/else test was necessitated by the fact that if the user clicked on 
> > the
> > same thumbnail image twice, the #dropdown element faded out and didn't fade
> > back in.
>
> > In FF clicking on the same image twice makes no change, but in Safari,
> > clicking on the same image twice makes no change IF #dropdown is visible, if
> > #dropdown is NOT visible and the user clicks on the same thumbnail that was
> > last clicked on, the loading gif displays but the #dropdown does not.
>
> > I'm sure this is just my own javascript inexperience, but can anyone suggest
> > where I'm going wrong?
>
> > Thanks,
> > Jon


[jQuery] Re: .getJSon

2009-03-14 Thread finco

Thanks for the code snippet Josh.  It's exactly what I was looking
for.  Certainly load works as well.  At this point I am trying to
understand various options for producing data on an intranet.  In the
past I have written asp pages which format the HTML and then use ajax
(with or without jquery) to insert the dormatted data.  I have assumed
that I might see a performance benefit by transporting raw data and
formatting it locally.  I'm not sure if that holds true.  Any
thoughts?

On Mar 14, 7:05 pm, Josh Powell  wrote:
> What I don't like about that method is the loss of ease of updating
> and reuse of code later on.  If you stick it in a table coming back,
> and need the some data somewhere else you cannot reuse it.  Also,
> changing things on server side requires recompiling in a java
> environment, which is a drag for html development.  In a PHP
> environment it wouldn't be as big of a deal though.
>
> It's also a matter of separating the data from the layout.  I prefer
> making an ajax request to retrieve data and do all of my layout/
> styling and interactivity in javascript.  That way it never becomes
> confusing where to go to update things.  If it's a data issue, you go
> to the server, if it's a layout/styling issue then the problem is in
> the javascript.  When you start breaking that line by putting html in
> the server side code, things can get messy.
>
> That said, what you are talking about is a perfectly valid way to
> code.
>
> On Mar 14, 2:10 pm, donb  wrote:
>
> > Then I must be missing something:
>
> > $("#placetoinsert").load("path/to/url");
>
> > would do the same thing, with the tableHTML constructed on the server
> > side.
>
> > On Mar 14, 5:02 pm, Josh Powell  wrote:
>
> > > Because it puts it in the javascript and lets you easily manipulate it
> > > with javascript.  If you get html back from the server, it's more
> > > difficult to manipulate.
>
> > > $.getJson('path/to/url',  function(data) {
> > >     var tableHTML = '';
> > >     $.each(data.aaData, function() {
> > >          tableHTML += '' + this[0] + '' + this[1] +
> > > '';
> > >     });
> > >     tableHTML += '';
> > >     $('#placeToInsert').append(tableHtml);
>
> > > });
>
> > > On Mar 14, 12:30 pm, donb  wrote:
>
> > > > If that's all your going to do with it, why not return a table from
> > > > the server and simply .load() it?  No transformation required in that
> > > > case.
>
> > > > On Mar 14, 9:23 am, finco  wrote:
>
> > > > > Sorry if this is a duplicate post - doesn't look like the last one
> > > > > went through.
>
> > > > > I've seen several examples of how to process json data with .each when
> > > > > the field names come over with json.  My data, howver, looks like the
> > > > > following:
>
> > > > > {"aaData": [
> > > > > ["1001-00-1535.000","Tenant Improvements"],
> > > > > ["1001-00-1558.000","Selling costs"],
> > > > > ["1001-00-1560.000","Financing Fees"],
> > > > > ["1001-00-1560.001","Financing Fees - Legal"],
> > > > > ["1001-00-1565.000","Lease Costs"],
> > > > > ["1001-00-1565.001","Lease Costs -Legal"],
> > > > > ["1001-00-1565.002","Lease Costs - Brokerage"],
> > > > > ["1001-00-1570.000","Legal Fees"]
> > > > > ]}
>
> > > > > How would I drop this data into a table?
>
> > > > > Thanks in advance for your help.


[jQuery] Mouseover twice to fire trigger?

2009-03-14 Thread mike

For some strange reason, the first time I attempt trigger an event
using mousover , I have to mouseover an element .accordionElement
twice (in, out, in of the element) before the trigger fires in Firefox
3. Once I fire the trigger once on that particular element, I can
mouse over it normally until the page is reloaded, then the same thing
happens.  I searched google and found others with similar problems but
now resolution.

Works fine in IE7. Code below. Any ideas?

TKS




 $(document).ready(function(){

startH = 24;
endH = 175;
speed = 700;
var mouseInConfig = {
  sensitivity: 3,
  interval: 200,
  over: makeTall,
  timeout: 1000,
  out: doNothing
};
$('.opened').animate({"height": endH + "px"}, speed);

$("#accordion .accordionElement").mouseover(function() {
if (this.className.indexOf('opened') == -1) {
$(this).hoverIntent(mouseInConfig);
}
});

function makeTall() {
$('.opened').animate({"height": startH + "px"},
speed).removeClass('opened');
$(this).addClass('opened').animate({"height": endH +
"px"}, speed);
}
function doNothing() {}

});


[jQuery] Re: Form plugin ajax file upload works in Firefox but not IE

2009-03-14 Thread John Scully
I was on v2.18 (still the latest rev listed on the jquery.com site).  I 
downloaded v2.24 and the problem is gone.


Thanks for the quick response though!

John
- Original Message - 
From: "Mike Alsup" 

To: "jQuery (English)" 
Sent: Saturday, March 14, 2009 7:18 PM
Subject: [jQuery] Re: Form plugin ajax file upload works in Firefox but not 
IE






I am having difficulty tracking this down - there is no apparent
error...just nothing happens. Nothing is sent to the server, so this
is not a problem with display the response - there is no response
because the form never submits.

Does anyone know about problems with IE7 or IE8 using the form plugin?

FYI - this system requires a login to get to it, so if someone wants
to take a look I can give you access.


I'm not aware of any outstanding issues with the Form Plugin.  Send me
a link.







No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.0.237 / Virus Database: 270.11.13/2001 - Release Date: 03/14/09 
06:54:00

No virus found in this outgoing message.
Checked by AVG - www.avg.com
Version: 8.0.237 / Virus Database: 270.11.13/2001 - Release Date: 03/14/09 
06:54:00


[jQuery] Re: Form plugin ajax file upload works in Firefox but not IE

2009-03-14 Thread Mike Alsup

> I am having difficulty tracking this down - there is no apparent
> error...just nothing happens.  Nothing is sent to the server, so this
> is not a problem with display the response - there is no response
> because the form never submits.
>
> Does anyone know about problems with IE7 or IE8 using the form plugin?
>
> FYI - this system requires a login to get to it, so if someone wants
> to take a look I can give you access.

I'm not aware of any outstanding issues with the Form Plugin.  Send me
a link.



[jQuery] Re: Cycle's fade effect not working in IE 7 or 6

2009-03-14 Thread Mike Alsup

> I'm having problems with transitions of a slideshow running with a
> thumbnail pager. Although the fade effect works fine in Firefox and
> Safari, in IE the content disappears completely before the next
> content abruptly appears.  Here's the test site (Cycle takes a few
> seconds to start)http://www.creativeresearch.uga.edu/cra.php/site/
> and following is the code. Any suggestions are much appreciated.

Try giving the actual slide elements (div.awardContent-CRA) a specific
height/width.


[jQuery] Executing javascript that comes inside an AJAX response

2009-03-14 Thread Foreigner

Hi,
I'm trying to use jQuery to get some HTML with Javascript using AJAX.
My response gets inserted into the contentDiv element but my
javascript inside the response doesn't get executed as the
documentation says (http://docs.jquery.com/
Specifying_the_Data_Type_for_AJAX_Requests).

Here goes my function with AJAX call:

function loadHtml(obj)
{
if(obj.className == "menuItem")
{
$.ajax({
 type:"GET",
 url:"content/" + obj.id + ".html",
 dataType: "html",
 success:
 function(data, status)
 {
  contentDiv.innerHTML = data;
 }
});
}
}


My response looks like:

Some heading


//Some javascript code




[jQuery] Form plugin ajax file upload works in Firefox but not IE

2009-03-14 Thread jmpfas

I have a very complex application I have constructed to create and
manage IVRs on asterisk servers.  I make heavy use of jquery and have
had few issues until now.

I do all my primary development in firefox and everything is working
fine there, but the tool for uploading prompts is not working in IE,
only in firefox.  I am aware that the form plugin uses a hidden iframe
to perform the file upload.

I am having difficulty tracking this down - there is no apparent
error...just nothing happens.  Nothing is sent to the server, so this
is not a problem with display the response - there is no response
because the form never submits.

Does anyone know about problems with IE7 or IE8 using the form plugin?

FYI - this system requires a login to get to it, so if someone wants
to take a look I can give you access.


[jQuery] Cycle's fade effect not working in IE 7 or 6

2009-03-14 Thread Madrugada

Greetings,

I'm having problems with transitions of a slideshow running with a
thumbnail pager. Although the fade effect works fine in Firefox and
Safari, in IE the content disappears completely before the next
content abruptly appears.  Here's the test site (Cycle takes a few
seconds to start) http://www.creativeresearch.uga.edu/cra.php/site/
and following is the code. Any suggestions are much appreciated.










  
Heading 1
Content 1
  



  
Heading 2
Content 2
  

  


$(function() {
$('#awardFeatures-CRA').before('
    ').cycle ({ fx:'fade', speed: 1000, timeout: 7000, cleartype: 1, pager: '.thumbnails-CRA', pauseOnPagerHover: true, pagerEvent: 'mouseover',pagerAnchorBuilder: function(idx, slide) { return '
  • '; } }); });

[jQuery] move simplemodal popUp ?!

2009-03-14 Thread globe

hi ,

plz i wanted to ask if it's possible to simplemodal popup movabe
across the page , instead of having him fix in a definite position ?
if not , is there a modale plugin who enable that ?

and thanks a lot


[jQuery] Re: Very New To JavaScript\JQuery - Mouseover and Mouseout Question

2009-03-14 Thread DLee

Perfect! I knew it couldn't have been that difficult. That's exactly
what I needed. Thanks!

On Mar 14, 5:04 pm, Josh Powell  wrote:
> The problem is this:
>
>  $(".block a").mouseover(function(){
>       $(".block a").animate({
>
> $('.block a') gets every instance of an a element with class block.
> So when you do the .animate on it, you are animating every element.
> Instead, you mean.
>
>  $(".block a").mouseover(function(){
>       $(this).animate({
>
> On Mar 14, 11:33 am, DLee  wrote:
>
> > Hi there,
>
> > I am having trouble grasping the usage of mouseover and mouseout when
> > dealing with a menu. I created a list of links and in testing, I've
> > been able to hover over each link and they will animate, move over 10
> > pixels. On mouse out, they will move back. That's great, except when I
> > hover over them, every link in the list moves. I want each link to
> > move over as I only hover over that particular link. Here's my markup:
>
> > 
> > 
> >   http://code.jquery.com/jquery-latest.js";>
>
> >   
> >   $(document).ready(function(){
>
> >     $(".block a").mouseover(function(){
> >       $(".block a").animate({
> >         marginLeft: "10px",
> >       }, 1500 );
> >     });
>
> >     $(".block a").mouseout(function(){
> >       $(".block a").animate({
> >         marginLeft: "0px",
> >       }, 1500 );
> >     });
>
> >   });
> >   
> >   
> >   div {
> >     background-color:#bca;
> >     width:100px;
> >     border:1px solid green;
> >   }
> >   
> > 
> > 
> >         
> >                 Link1
> >                 Link2
> >                 Link3
> >                 Link4
> >         
> > 
> > 
>
> > Any help would be much appreciated. Thanks in advance!
> > DLee


[jQuery] Re: .getJSon

2009-03-14 Thread Josh Powell

What I don't like about that method is the loss of ease of updating
and reuse of code later on.  If you stick it in a table coming back,
and need the some data somewhere else you cannot reuse it.  Also,
changing things on server side requires recompiling in a java
environment, which is a drag for html development.  In a PHP
environment it wouldn't be as big of a deal though.

It's also a matter of separating the data from the layout.  I prefer
making an ajax request to retrieve data and do all of my layout/
styling and interactivity in javascript.  That way it never becomes
confusing where to go to update things.  If it's a data issue, you go
to the server, if it's a layout/styling issue then the problem is in
the javascript.  When you start breaking that line by putting html in
the server side code, things can get messy.

That said, what you are talking about is a perfectly valid way to
code.

On Mar 14, 2:10 pm, donb  wrote:
> Then I must be missing something:
>
> $("#placetoinsert").load("path/to/url");
>
> would do the same thing, with the tableHTML constructed on the server
> side.
>
> On Mar 14, 5:02 pm, Josh Powell  wrote:
>
> > Because it puts it in the javascript and lets you easily manipulate it
> > with javascript.  If you get html back from the server, it's more
> > difficult to manipulate.
>
> > $.getJson('path/to/url',  function(data) {
> >     var tableHTML = '';
> >     $.each(data.aaData, function() {
> >          tableHTML += '' + this[0] + '' + this[1] +
> > '';
> >     });
> >     tableHTML += '';
> >     $('#placeToInsert').append(tableHtml);
>
> > });
>
> > On Mar 14, 12:30 pm, donb  wrote:
>
> > > If that's all your going to do with it, why not return a table from
> > > the server and simply .load() it?  No transformation required in that
> > > case.
>
> > > On Mar 14, 9:23 am, finco  wrote:
>
> > > > Sorry if this is a duplicate post - doesn't look like the last one
> > > > went through.
>
> > > > I've seen several examples of how to process json data with .each when
> > > > the field names come over with json.  My data, howver, looks like the
> > > > following:
>
> > > > {"aaData": [
> > > > ["1001-00-1535.000","Tenant Improvements"],
> > > > ["1001-00-1558.000","Selling costs"],
> > > > ["1001-00-1560.000","Financing Fees"],
> > > > ["1001-00-1560.001","Financing Fees - Legal"],
> > > > ["1001-00-1565.000","Lease Costs"],
> > > > ["1001-00-1565.001","Lease Costs -Legal"],
> > > > ["1001-00-1565.002","Lease Costs - Brokerage"],
> > > > ["1001-00-1570.000","Legal Fees"]
> > > > ]}
>
> > > > How would I drop this data into a table?
>
> > > > Thanks in advance for your help.


[jQuery] Re: Please help me SPEED UP my dev. MySQL => PHP => JSON => AJAX => jQueryUI

2009-03-14 Thread dani

Big thanks to both of you!


[jQuery] Re: test for .is(":visible") fails in Safari

2009-03-14 Thread Jon Crump


Dear all,

OK, solved it myself in case anyone's still listening. It still remains a 
puzzle why safari on Mac interprets the code differently.


The if/else test below isn't necessary. The fadeOut was executing, but the 
.load() callback failed when the .thumb clicked was the same one as the 
previous click. Both FF and IE didn't blink when the src of #pic remained 
the same, but safari wouldn't execute the .load callback because nothing 
loaded: the src of #pic remained the same.


The solution for my purposes was to set the src of #pic to null and then 
re-set it to pix[imgName].imgSrc whatever it might be, then .load() sees 
that something has loaded and executes the callback.


Is this a known discrepancy between how FF, IE, and Safari interpret 
.load(), or something completely screwy and idiosyncratic to my klugy 
code? (jQuery 1.2.6, by the way, in safari 3.1.2)


Jon

On Fri, 13 Mar 2009, Jon Crump wrote:



Dear all,

I'm not sure if this is a jQuery question or not, but I got the following 
code to work in FF, but it fails in Safari:


$(".thumb").click(function() {
   var imgName = $(this).attr("alt");
   var el = $("#dropdown");
   if (el.is(":visible") && $("#pic").attr("name") == imgName) return;
   else {
   el.fadeOut("slow", function() {
   $("#loading").show();

   el.find("#textContent")
   .text(pix[imgName].aText);

   el.find("#pic")
   .attr({"src": pix[imgName].imgSrc, "name": imgName})
   .load(function(){
   el.fadeIn("slow");
   $("#loading").hide();
   });
   });
   }
});

The if/else test was necessitated by the fact that if the user clicked on the 
same thumbnail image twice, the #dropdown element faded out and didn't fade 
back in.


In FF clicking on the same image twice makes no change, but in Safari, 
clicking on the same image twice makes no change IF #dropdown is visible, if 
#dropdown is NOT visible and the user clicks on the same thumbnail that was 
last clicked on, the loading gif displays but the #dropdown does not.


I'm sure this is just my own javascript inexperience, but can anyone suggest 
where I'm going wrong?


Thanks,
Jon



[jQuery] Re: Need example of dynamic validation

2009-03-14 Thread Loony2nz

I think I got it.. can someone validate this for me..see if I'm on the
right track?

rules: {
regType: {required: true},
first_name: {required:true},
last_name: {required:true},
individual_state: {
required: function(element) {
return $('input[name=regType]:checked').val() == 'Individual'
}
},
business_state: {
required: function(element) {
return $('input[name=regType]:checked').val() != 'Individual'
}
}

Thanks!


On Mar 14, 2:55 pm, Loony2nz  wrote:
> validation.
>
> basically if they choose individual, show the individual section of
> the form and make those fields validate (address, city, state, zip all
> required).
> but if they choose business don't make the individual section
> required.
>
> i'm lost how to do this logic in the jQuery validation plug in..
>
> thanx for your response.
>
> On Mar 14, 2:46 pm, "Rick Faircloth"  wrote:
>
> > Is it "validation" you need, or just something to respond to their
> > choice in order to set up your page accordingly?
>
> > > -Original Message-
> > > From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
> > > Behalf Of Loony2nz
> > > Sent: Saturday, March 14, 2009 5:31 PM
> > > To: jQuery (English)
> > > Subject: [jQuery] [validate] Need example of dynamic validation
>
> > > Hi all,
>
> > > I need an example for this situation:
>
> > > I have a form that dynamically shows different parts of the form based
> > > on radio button choices.
>
> > > Example:  Registrion type:  Business or Individual radio buttons
>
> > > If they click on Business, I have a portion of the page only show
> > > business information fields.
> > > If they click on Individual, I have another portion of the page only
> > > show individual information fields.
>
> > > How can I validate, say, "business_state" or "individual_state" based
> > > on the radio button choice?
>
> > > If I put in validation in the function for both fields, I get no
> > > validation and the form passes.  But, if I put in one or the other
> > > validation the form does the validation and doesn't pass.
>
> > > help :(
>
> > > Thanks!
>
> > > No virus found in this incoming message.
> > > Checked by AVG -www.avg.com
> > > Version: 8.5.278 / Virus Database: 270.11.12/1998 - Release Date:
> > > 03/14/09 06:54:00


[jQuery] Re: [validate] Need example of dynamic validation

2009-03-14 Thread Loony2nz

validation.

basically if they choose individual, show the individual section of
the form and make those fields validate (address, city, state, zip all
required).
but if they choose business don't make the individual section
required.

i'm lost how to do this logic in the jQuery validation plug in..

thanx for your response.

On Mar 14, 2:46 pm, "Rick Faircloth"  wrote:
> Is it "validation" you need, or just something to respond to their
> choice in order to set up your page accordingly?
>
> > -Original Message-
> > From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
> > Behalf Of Loony2nz
> > Sent: Saturday, March 14, 2009 5:31 PM
> > To: jQuery (English)
> > Subject: [jQuery] [validate] Need example of dynamic validation
>
> > Hi all,
>
> > I need an example for this situation:
>
> > I have a form that dynamically shows different parts of the form based
> > on radio button choices.
>
> > Example:  Registrion type:  Business or Individual radio buttons
>
> > If they click on Business, I have a portion of the page only show
> > business information fields.
> > If they click on Individual, I have another portion of the page only
> > show individual information fields.
>
> > How can I validate, say, "business_state" or "individual_state" based
> > on the radio button choice?
>
> > If I put in validation in the function for both fields, I get no
> > validation and the form passes.  But, if I put in one or the other
> > validation the form does the validation and doesn't pass.
>
> > help :(
>
> > Thanks!
>
> > No virus found in this incoming message.
> > Checked by AVG -www.avg.com
> > Version: 8.5.278 / Virus Database: 270.11.12/1998 - Release Date:
> > 03/14/09 06:54:00


[jQuery] Re: [validate] Need example of dynamic validation

2009-03-14 Thread Rick Faircloth

Is it "validation" you need, or just something to respond to their
choice in order to set up your page accordingly?

> -Original Message-
> From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
> Behalf Of Loony2nz
> Sent: Saturday, March 14, 2009 5:31 PM
> To: jQuery (English)
> Subject: [jQuery] [validate] Need example of dynamic validation
> 
> 
> Hi all,
> 
> I need an example for this situation:
> 
> I have a form that dynamically shows different parts of the form based
> on radio button choices.
> 
> Example:  Registrion type:  Business or Individual radio buttons
> 
> If they click on Business, I have a portion of the page only show
> business information fields.
> If they click on Individual, I have another portion of the page only
> show individual information fields.
> 
> How can I validate, say, "business_state" or "individual_state" based
> on the radio button choice?
> 
> 
> If I put in validation in the function for both fields, I get no
> validation and the form passes.  But, if I put in one or the other
> validation the form does the validation and doesn't pass.
> 
> help :(
> 
> Thanks!
> 
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 8.5.278 / Virus Database: 270.11.12/1998 - Release Date:
> 03/14/09 06:54:00



[jQuery] [validate] Need example of dynamic validation

2009-03-14 Thread Loony2nz

Hi all,

I need an example for this situation:

I have a form that dynamically shows different parts of the form based
on radio button choices.

Example:  Registrion type:  Business or Individual radio buttons

If they click on Business, I have a portion of the page only show
business information fields.
If they click on Individual, I have another portion of the page only
show individual information fields.

How can I validate, say, "business_state" or "individual_state" based
on the radio button choice?


If I put in validation in the function for both fields, I get no
validation and the form passes.  But, if I put in one or the other
validation the form does the validation and doesn't pass.

help :(

Thanks!


[jQuery] Re: .getJSon

2009-03-14 Thread donb

Then I must be missing something:

$("#placetoinsert").load("path/to/url");

would do the same thing, with the tableHTML constructed on the server
side.

On Mar 14, 5:02 pm, Josh Powell  wrote:
> Because it puts it in the javascript and lets you easily manipulate it
> with javascript.  If you get html back from the server, it's more
> difficult to manipulate.
>
> $.getJson('path/to/url',  function(data) {
>     var tableHTML = '';
>     $.each(data.aaData, function() {
>          tableHTML += '' + this[0] + '' + this[1] +
> '';
>     });
>     tableHTML += '';
>     $('#placeToInsert').append(tableHtml);
>
> });
>
> On Mar 14, 12:30 pm, donb  wrote:
>
> > If that's all your going to do with it, why not return a table from
> > the server and simply .load() it?  No transformation required in that
> > case.
>
> > On Mar 14, 9:23 am, finco  wrote:
>
> > > Sorry if this is a duplicate post - doesn't look like the last one
> > > went through.
>
> > > I've seen several examples of how to process json data with .each when
> > > the field names come over with json.  My data, howver, looks like the
> > > following:
>
> > > {"aaData": [
> > > ["1001-00-1535.000","Tenant Improvements"],
> > > ["1001-00-1558.000","Selling costs"],
> > > ["1001-00-1560.000","Financing Fees"],
> > > ["1001-00-1560.001","Financing Fees - Legal"],
> > > ["1001-00-1565.000","Lease Costs"],
> > > ["1001-00-1565.001","Lease Costs -Legal"],
> > > ["1001-00-1565.002","Lease Costs - Brokerage"],
> > > ["1001-00-1570.000","Legal Fees"]
> > > ]}
>
> > > How would I drop this data into a table?
>
> > > Thanks in advance for your help.


[jQuery] Re: Very New To JavaScript\JQuery - Mouseover and Mouseout Question

2009-03-14 Thread Josh Powell

The problem is this:

 $(".block a").mouseover(function(){
  $(".block a").animate({

$('.block a') gets every instance of an a element with class block.
So when you do the .animate on it, you are animating every element.
Instead, you mean.


 $(".block a").mouseover(function(){
  $(this).animate({

On Mar 14, 11:33 am, DLee  wrote:
> Hi there,
>
> I am having trouble grasping the usage of mouseover and mouseout when
> dealing with a menu. I created a list of links and in testing, I've
> been able to hover over each link and they will animate, move over 10
> pixels. On mouse out, they will move back. That's great, except when I
> hover over them, every link in the list moves. I want each link to
> move over as I only hover over that particular link. Here's my markup:
>
> 
> 
>   http://code.jquery.com/jquery-latest.js";>
>
>   
>   $(document).ready(function(){
>
>     $(".block a").mouseover(function(){
>       $(".block a").animate({
>         marginLeft: "10px",
>       }, 1500 );
>     });
>
>     $(".block a").mouseout(function(){
>       $(".block a").animate({
>         marginLeft: "0px",
>       }, 1500 );
>     });
>
>   });
>   
>   
>   div {
>     background-color:#bca;
>     width:100px;
>     border:1px solid green;
>   }
>   
> 
> 
>         
>                 Link1
>                 Link2
>                 Link3
>                 Link4
>         
> 
> 
>
> Any help would be much appreciated. Thanks in advance!
> DLee


[jQuery] Re: .getJSon

2009-03-14 Thread Josh Powell

Because it puts it in the javascript and lets you easily manipulate it
with javascript.  If you get html back from the server, it's more
difficult to manipulate.

$.getJson('path/to/url',  function(data) {
var tableHTML = '';
$.each(data.aaData, function() {
 tableHTML += '' + this[0] + '' + this[1] +
'';
});
tableHTML += '';
$('#placeToInsert').append(tableHtml);
});



On Mar 14, 12:30 pm, donb  wrote:
> If that's all your going to do with it, why not return a table from
> the server and simply .load() it?  No transformation required in that
> case.
>
> On Mar 14, 9:23 am, finco  wrote:
>
> > Sorry if this is a duplicate post - doesn't look like the last one
> > went through.
>
> > I've seen several examples of how to process json data with .each when
> > the field names come over with json.  My data, howver, looks like the
> > following:
>
> > {"aaData": [
> > ["1001-00-1535.000","Tenant Improvements"],
> > ["1001-00-1558.000","Selling costs"],
> > ["1001-00-1560.000","Financing Fees"],
> > ["1001-00-1560.001","Financing Fees - Legal"],
> > ["1001-00-1565.000","Lease Costs"],
> > ["1001-00-1565.001","Lease Costs -Legal"],
> > ["1001-00-1565.002","Lease Costs - Brokerage"],
> > ["1001-00-1570.000","Legal Fees"]
> > ]}
>
> > How would I drop this data into a table?
>
> > Thanks in advance for your help.


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

2009-03-14 Thread Tin

Richard,

I don't know how well SlickGrid aligns with what most people would
expect of a jQueryUI Grid plugin.
The key difference is that most of the grid implementations listed on
the jQuery UI wiki (jqGrid, DataTables, ...)  focus too much on being
able to work with data (search, sort, parse, ajax load, etc.) and not
enough on being a better "grid" (or in case of editable grids, a
spreadsheet).  It's great if all you want to do is to "spruce up" an
HTML TABLE, but too inflexible for anything more.  SlickGrid itself
only deals with rendering, virtual scrolling, keyboard navigation,
loading cell editors when needed, managing validation state, doing
common things like column resize/reorder and passing events through to
the Controller.  The core code is very concise.  If you want it to do
more, add custom cell formatters, rich cell editors, a Model that
implements filtering, expand/collapse, sorting, ajax-loading, etc.
You're not locked in to any particular way of doing anything.  (Again,
I apologize for the lack of design documentation and MVC examples -
I'm working on that.)

Dojo Grid is somewhat similar in its approach and functionality.  The
reason I decided to implement my own is because Dojo Grid is way too
heavy-handed for my taste.  Too complex with too many dependencies.
There's no reason you can't have all of that in a small and simple
component.  The other reason was their implementation of virtual
scrolling - it just wasn't responsive enough for me.  SlickGrid
dynamically switches between synchronous and asynchronous rendering in
order to deliver the fastest rerendering possible.

I would love nothing more than for this to become part of jQuery UI.
If you go over the code and the examples and decide that this is in
line with where you want to take GridTable, email me directly at
michael.leib...@gmail.com.

Thanks,
+Michael



On Mar 14, 6:35 am, "Richard D. Worth"  wrote:
> Michael and Anatoly (and anyone else that my be interested), I hope you
> consider joining us with your efforts over here:
>
> http://wiki.jqueryui.com/GridTable
>
> Thanks.
>
> - Richard
>
>
>
> On Sat, Mar 14, 2009 at 1:19 AM, AnatolyG  wrote:
>
> > Michael,
>
> > Great job. I built a prototype of my own table for the same reasons a
> > few months ago. The grid looks good, but for my purposes (and I am
> > sure for many others), while having an array of rows is great and
> > useful, the plugin should be able to create such tables from a regular
> >  element. I am working on an enterprise app that outputs via
> > xslt a table with a bunch of data, and it would be great to run this
> > code as a plugin to convert the table (with rules for each column?)
> > into a spreadsheet like in your last example. Should be fairly
> > straight forward to do that..
>
> > I am also looking for sorting (shouldn't be too bad), locking columns,
> > locking header (done) and locking footer. I implemented these in my
> > prototype already, as well as the rendering from table element.
> > Anyway, I would love to help out in some capacity, if you're looking
> > to develop this further.
>
> > Anatoly
>
> > On Mar 9, 5:31 am, Tin  wrote:
> > > Hey All,
>
> > > I've been working on a grid/spreadsheet control prototype during the
> > > last couple of weeks.  Seeing how there doesn't seem to be a lot of
> > > other choices for this sort of thing, I had to write my own.  I've put
> > > the project up on Google Code and am looking for experienced
> > > developers who can pick this up and turn it into something that
> > > everybody can use (a jQuery UI grid plugin?).
>
> > > The project is hosted athttp://code.google.com/p/slickgrid/.
> > > Below is a copy of the project home page.
>
> > > Looking forward to your feedback!
>
> > > Michael Leibman
> > > michael.leib...@gmail.com
> > > Principal Engineer
> > > Daptiv Inc.
>
> > --- 
> > ---
>
> > > SlickGrid
>
> > > What it is
>
> > > Quite simply, SlickGrid is a JavaScript grid/spreadsheet component.
>
> > > Some highlights:
>
> > > Virtual scrolling/rendering (hundreds of thousands of rows)
> > > Extremely fast rendering speed
> > > Configurable & customizable
> > > Full keyboard navigation
> > > Resizable/reorderable columns
> > > Custom cell formatters & editors
> > > Support for editing and creating new rows.
> > > "GlobalEditorLock" to manage concurrent edits in cases where multiple
> > > Views on a page can edit the same data.
> > > Why?
>
> > > This is pretty much a work-in-progress prototype, so I don't feel like
> > > spending a lot of time documenting it at this stage. I do think it is
> > > quite promising though, so I'm putting it up for everybody to see and
> > > play with. In its current form, it satisfies nearly all of the
> > > requirements for the project I am working on where I am utilizing it
> > > in an MVC application, so I'm not sure how much time I can afford on
> > > turning 

[jQuery] custom function to run on specific field with jquery validate plugin

2009-03-14 Thread paulswansea

Does anybody know of a way to run a custom function on a specific
field if it is incorrect when validating an entire form?

TIA


[jQuery] Re: Flying clouds like in http://devthought.com/

2009-03-14 Thread ricardobeat

That's the code in use on the page you mentioned.

I guess you could do something like that with jQuery's built-in animate
() function:

(function animateMe(){

$('#cloud1')
  .animate({ marginLeft:"+=200px" }, 2000)
  .animate({ marginLeft:"-=200px" }, 2000, function(){
 animateMe();
  });
})();


On Mar 14, 3:26 pm, Grom  wrote:
> Its not that. He wrote code to move image using mootools. Im looking
> for something to move image on page for Jquery
>
> On 14 Mar, 18:44, ricardobeat  wrote:
>
> >http://devthought.com/projects/mootools/apng/
>
> > On Mar 14, 12:29 pm, Grom  wrote:
>
> > > Hello.
> > > I want to add flying clouds like onhttp://devthought.com/onmysite.
> > > Do anyone know how to do that? Maybe any suggestions?


[jQuery] Re: wrap some tag around group of table rows for hide and show

2009-03-14 Thread ricardobeat

You can't wrap any element around s. Tables can only contain a
tbody/thead/tfoot and TRs, if you insert an element that is not
allowed, it itself will be wrapped by a new TR created by the browser,
and you'll get all kinds of misbehavior. You could insert a new tbody,
but browser handling of them is different.

The problem is that the tbodies are being set to display:block after
the show('fast') call. Changing that to fadeIn('fast') seems to work,
I'm not sure why - both should restore the original display.

cheers,
- ricardo

On Mar 14, 1:47 pm, Lwangaman  wrote:
> Ok let's see if this post works... The last couple tries didn't!
>
> I was reading through this year-old thread which I found googling
> since I'm doing something similar, perhaps someone could give me a
> couple tips.
>
> Here is the page with the example I'm dealing 
> with:http://johnrdorazio.altervista.org/SitoFlatnukePersonale/index.php?mo...
>
> Clicking on the checkboxes, two rows should appear (which were hidden
> from the beginning) in which more information can be inserted (that
> otherwise would not be necessary).
>
> The only problem is, it seems to work only in Internet Explorer. In
> Firefox the rows wind up appearing at the bottom of the table, and
> every time you un-click and re-click some mysterious space begins
> accumulating. Not only, but the cells of the two appearing rows don't
> line up with the cells of all the other rows of the table, the seem to
> want to line up with only the first column which really opens up wide
> that first column shifting the whole table over to the right. Google
> Chrome presents a similar problem, only the appearing rows don't wind
> up at the bottom of the table. They stay where they're supposed to be,
> but the cells still don't line up and they shift the whole table, and
> un-click re-click still creates that mysterious gap.
>
> At first I was applying JQuery directly to the rows that were
> involved, then reading this thread I tried creating different "tbody"
> sections and applying the JQuery to those sections, but the problems
> remain. Perhaps it could be a problem of parent-child relationships?
> I'm not sure how those work though, if anyone has any thoughts I would
> be very grateful.
>
> Here is my code:
>
> 
> 
>
> $(document).ready(function(){
>
> $(".showhidesection").hide();
> $("#pastoralcounsel").click(function(){
> if ($("#pastoralcounsel:checked").val()!=null)
> {
> $("#represents").show("fast");}
>
> else
> {
> $("#represents").hide("fast");}
> });
>
> $("#i_am_a_catechist").click(function(){
> if ($("#i_am_a_catechist:checked").val()!=null)
> {
> $("#catechizes").show("fast");}
>
> else
> {
> $("#catechizes").hide("fast");}
> });
>
> $("#volunteer").click(function(){
> if ($("#volunteer:checked").val()!=null)
> {
> $("#volunteers").show("fast");}
>
> else
> {
> $("#volunteers").hide("fast");
>
> }
> });
> });
>
> 
>
> 
>
> 
>  id="pastoralcounsel">Cons.
> Pastorale
> 
>
> 
> --- -> rappresenta: td>
> ... id="i_represent">
> 
>
> 
>  id="i_am_a_catechist"> for="i_am_a_catechist">Catechista
> 
>
> 
> --- -> del
> gruppo:
> ... id="i_catechize_this_group">I^ Anno Comunioni select>
> 
>
> 
>  td>Volontario parrocchiale tr>
> 
>
> >
> --- -> servizio: label>
> ... id="voluntaryservice" />
> 
>
> 


[jQuery] Re: Simple toggle between slide up slide down and changing paragraph html contents not working...

2009-03-14 Thread Jsbeginner
Thankyou, I've at last got it working, I used the href attribute to 
specify if the text is hidden or not (I will add the html code with 
javascript and will supply a PHP version for navigators that are not 
compatible with javascript), to begin with I wanted to use the toggle 
function but I needed to be able to skip a status and didn't know if 
this was even possible. I don't know if there is a better way but here 
is how I ended up doing it (any advice to make my code better would be 
great :)) :


Here is my code :
JS :
-
$("a.change").each(function(){
$(this).click(function(){
   if($(this).attr("href") == "up"){
   $("a.change").each(function(){
   if($(this).attr("href") == "down"){
   $(this).parent("p").prev("p").slideUp(300);
   $(this).attr("href","up");
   $(this).text("Click to show");
   }
   });
$(this).parent("p").prev("p").slideDown(300);
   $(this).attr("href","down");
   $(this).text("Click to hide");
   } else {
$(this).parent("p").prev("p").slideUp(300);
   $(this).attr("href","up");
   $(this).text("Click to show");
   }
   return false;
   });
});
-
HTML :
-

   
   Item 1
   Hidden contents 1
   Click to show
   
   
   Item 2
   Hidden contents 2
   Click to show
   
   
   Item 3
   Hidden contents 3
   Click to show
   

-
Jonathan wrote:

.each() should do what you want.

It will iterate through each element that has the class "Item" and
will set "this" to that individual element. So no $(this) will not be
the same as $(.item)  e.g with this markup




$(".item").each() will execute twice with "this" being the DIV then
the SPAN.



Jsbeginner wrote:
  

Hello again, I've been continuing my search and it seems that the .each
function is not working the way I wanted it to...

 From what I've understood $(".item").each(function(){}) just counts how
many elements have the 'item' class, and then executes the code that
number of times with $(this) being the same as $(".item").

How would I go about running a function on each element ? would I have
to do something with a counter an the next function to achieve this ? or
is there an easier way ?

Thankyou.

Jsbeginner wrote :


Hello,

I've been struggling with a very simple code that I can't get to work ...

Simplified html :


   
   Item 1
   Hidden contents 1
   Click to show
   
   
   Item 2
   Hidden contents 2
   Click to show
   
   
   Item 3
   Hidden contents 3
   Click to show
   


This is what I want to do :

When you click on a Click to show link it shows the hidden contents
contained in the item's "toggle" paragraphe and changes the link text
to "Click to hide".
I also want to only be able to have one hidden contents showing at a
time, so I would like to be able to hide any other visible hidden
contents before showing the hidden contents asked for.

I know my code isn't perfect but the following code works to some
extent : I can show or hide the contents but not hide all other
contents before showing new contents.
--
function down() {
   $("a.down").each(function(){
   $(this).click(function(){
   reinit();
   $(this).parent("p").prev("p").slideDown(300);
   $(this).parent("p").html("Click
to hide");
   up();
   return false;
   });
});
}

function up() {
   $("a.up").each(function(){
   $(this).click(function(){
   $(this).parent("p").prev("p").slideUp(300);
   $(this).parent("p").html("Click to show");
   down();
   return false;
   });
});
}

function reinit(){
   $(".toggle").each(function(){
   $(this).slideUp(300);
   $(this).next("p").html("Click to
show");
   });
  }

$(document).ready(function(){
   down();
});
--

There is just one line that doesn't work it's in the reinit function :

$(this).next("p").html("Click to show");

I've been trying lots of ways to get this working without success... I
thought it would work with the next function but no luck.

If it will help you to find what I've done wrong I've put all the
necessary code (except the jquery library) in one html file, I've not
added it to this help request to not make it too long,  but if you
find it difficult to follow me I can post it's contents so you can
test it.

Thankyou.







  


  




[jQuery] Re: .getJSon

2009-03-14 Thread donb

If that's all your going to do with it, why not return a table from
the server and simply .load() it?  No transformation required in that
case.

On Mar 14, 9:23 am, finco  wrote:
> Sorry if this is a duplicate post - doesn't look like the last one
> went through.
>
> I've seen several examples of how to process json data with .each when
> the field names come over with json.  My data, howver, looks like the
> following:
>
> {"aaData": [
> ["1001-00-1535.000","Tenant Improvements"],
> ["1001-00-1558.000","Selling costs"],
> ["1001-00-1560.000","Financing Fees"],
> ["1001-00-1560.001","Financing Fees - Legal"],
> ["1001-00-1565.000","Lease Costs"],
> ["1001-00-1565.001","Lease Costs -Legal"],
> ["1001-00-1565.002","Lease Costs - Brokerage"],
> ["1001-00-1570.000","Legal Fees"]
> ]}
>
> How would I drop this data into a table?
>
> Thanks in advance for your help.


[jQuery] how to do error handling in ajax

2009-03-14 Thread prashantroy1...@gmail.com

Hi Jquery guys,

I am using below syntax for ajax error handling, but I never got any
specific error details. its always undefined.

function Error(xhr, ajaxOptions, thrownError)
{
// dump is javascript dump
dump(xhr, true);
dump(ajaxOptions, true);
dump(thrownError, true);
}

pls suggest what to do.

note: for dump:
http://www.netgrow.com.au/files/javascript_dump.cfm


[jQuery] Re: Please help me SPEED UP my dev. MySQL => PHP => JSON => AJAX => jQueryUI

2009-03-14 Thread Mat Schaffer

On Mar 14, 2009, at 4:38 AM, dani wrote:
> Before taking on a challenging task, please give me some ideas to
> speed up my development!
>
> Just as the topic is saying, I will primarily be doing: MySQL => PHP
> => JSON => AJAX => jQueryUI
>
> I used to work with CakePHP but I have little experience with JSON.
> Any hints on your favourite tools and helpers (MVC frameworks, MySQL
> tools, JSON parsers, jQuery extensions etc.) are greatly appreciated.
>
> If you think I should modify my "route", for example XML instead of
> JSON, please put forward the pros and cons.

Seems reasonable. If you're stuck on PHP, you might want to also check  
out http://www.phpfuse.net. I find it to be a little less verbose than  
CakePHP.
-Mat


[jQuery] Re: Cycle not working with other plugins

2009-03-14 Thread Mike Alsup

> I'm trying to get Cycle to work with Kwicks, actually just trying to
> get it to work on this page:
> 
> I've got the cycle working on its own but not within this page.

Replace this:

$(function() {
// run the code in the markup!
$('#demos pre code').each(function() {
eval($(this).text());
});
});


with this:

$(function() {
$('#s1').cycle('fade');
});


[jQuery] Very New To JavaScript\JQuery - Mouseover and Mouseout Question

2009-03-14 Thread DLee

Hi there,

I am having trouble grasping the usage of mouseover and mouseout when
dealing with a menu. I created a list of links and in testing, I've
been able to hover over each link and they will animate, move over 10
pixels. On mouse out, they will move back. That's great, except when I
hover over them, every link in the list moves. I want each link to
move over as I only hover over that particular link. Here's my markup:



  http://code.jquery.com/jquery-latest.js";>

  
  $(document).ready(function(){


$(".block a").mouseover(function(){
  $(".block a").animate({
marginLeft: "10px",
  }, 1500 );
});

$(".block a").mouseout(function(){
  $(".block a").animate({
marginLeft: "0px",
  }, 1500 );
});

  });
  
  
  div {
background-color:#bca;
width:100px;
border:1px solid green;
  }
  



Link1
Link2
Link3
Link4




Any help would be much appreciated. Thanks in advance!
DLee


[jQuery] Re: Flying clouds like in http://devthought.com/

2009-03-14 Thread Grom

Its not that. He wrote code to move image using mootools. Im looking
for something to move image on page for Jquery

On 14 Mar, 18:44, ricardobeat  wrote:
> http://devthought.com/projects/mootools/apng/
>
> On Mar 14, 12:29 pm, Grom  wrote:
>
> > Hello.
> > I want to add flying clouds like onhttp://devthought.com/onmy site.
> > Do anyone know how to do that? Maybe any suggestions?


[jQuery] questions about binding events

2009-03-14 Thread ulgold

When I try to bind events like within ajax call:

$.ajax({
type: 'POST',
...

success: function(msg) {

 $("#dmid img", msg).each ( function() {

 $(this).bind('mouseover', handler)
...

problem is the event is not bound   unless I do something like:
$('#firstdiv').html(msg)
$("#dmid img").each ( function() {
$(this).bind('mouseover', handler)


Any idea why we cannot bind events when context is  other than the
current loaded document?


Another question:
I have the option of writing onclick events  within HTML page like:





or using jquery to bind the onclick events above when the document has
loaded like

$("imgg").each ( function() {
$(this).bind('mouseover', imghandlerr)
}

Apart from the fact that the page size that is transported from the
server to the client is reduced when using jquery binding of events
( due to missing hard coded onclick handlers in html), are there any
other advantages or disadvantages of either approach?


[jQuery] How to repeat Jcarousel

2009-03-14 Thread Pathan

Hi,
I am using JQUERY plugin Jcarousel in one of my project. Is this
possible to create two carousel in single page? Whenever I try to the
2nd one just display a plain unordered list. Any help will be
appreciated.
Thanks


[jQuery] questions about binding events Click to flag this post

2009-03-14 Thread alanz

When I try to bind events like within ajax call:

$.ajax({
type: 'POST',
...

success: function(msg) {

 $("#dmid img", msg).each ( function() {

 $(this).bind('mouseover', handler)
...

problem is the event is not bound   unless I do something like:
$('#firstdiv').html(msg)
$("#dmid img").each ( function() {
$(this).bind('mouseover', handler)


Any idea why we cannot bind events when context is  other than the
current loaded document?


Another question:
I have the option of writing onclick events  within HTML page like:





or using jquery to bind the onclick events above when the document has
loaded like

$("imgg").each ( function() {
$(this).bind('mouseover', imghandlerr)
}

Apart from the fact that the page size that is transported from the
server to the client is reduced when using jquery binding of events
( due to missing hard coded onclick handlers in html), are there any
other advantages or disadvantages of either approach?


[jQuery] Nonintegers for controls in static_controls.html example?

2009-03-14 Thread pecheney

I tried to post this yesterday but was not a member, so pardon me if
you see this twice.  I run about 15 forums and am not an idiot i
promise.   I am under a  deadline with a scary client who is
"demanding" this functionality.  go figure.  Simply put, I, too, am
trying to use a noninteger as some others but cannot figure out the
fix.   I am using  the static_controls.html example and almost have it
figured out.  The controls are numbered 1 -1 0 by default. Click on 1
and it goes to teh 1 list item which in teh example is a yellow
flower.  Click on #8 anmd it is a red flower.   I simply want to name
them with letters instead for navigation.  Here is example as far as I
got it and you can see all numbers work, except the control labeled
"about" which defaults back  to  the #1 control/anchor and not the 8th
(red flower)  
http://www.paulcheney.com/jcarousel/examples/static_controls.html
.  YOu can see the 10th item i just pulled one of my websites in.

Please padon the ugliness of where i took it but i am simply making a
website that slides from page to page per clients request and using an
inline frame to call separate pages via the jcaousel list items.  Do I
HAVE t o use numbers opr can I make this work with letters?  Does thsi
make any sense? Any help is super appreciated!!



[jQuery] Cycle not working with other plugins

2009-03-14 Thread davidlef

I'm trying to get Cycle to work with Kwicks, actually just trying to
get it to work on this page:

I've got the cycle working on its own but not within this page.

David


[jQuery] Re: find among same elements using name

2009-03-14 Thread Alain Roger
>
> [name=row]
>

do you mean find('td[name=row]') ?

A.


[jQuery] Block UI and Overlay IE 6

2009-03-14 Thread dyke

Hello, I trying to set the full width for overlay for Block Ui
(malsup), but the overlay cover only the window width( not the
document width). Well, that seems to be bug of block ui, but is there
any way to fix it on my site? The problem can be visible, when page
has over 1000px width. Then you try to watch site on some small
resolution, like in palmtop or sth, where you have less then 800px of
width. The effect is not very well, eg. if we have 800px resolution of
width, and you scroll to the right, left 200px don't have the overlay,
and is clickable.


[jQuery] Re: find among same elements using name

2009-03-14 Thread Josh Powell

[name=row]



On Mar 14, 10:58 am, Alain Roger  wrote:
> Hi,
>
> i have a table with checkboxes which allows user to select all row/records
> or none.
> they have all the same name : row
> i would like to know if there is an easy way to find them in my table ?
> i was thinking about something like :
> $("#grid").find('td:row').each(function(i)
> {
>  ...
>
> });
>
> when td:row would mean each  having name = row.
>
> is there something like that ?
>
> thx.
>
> A.


[jQuery] find among same elements using name

2009-03-14 Thread Alain Roger
Hi,

i have a table with checkboxes which allows user to select all row/records
or none.
they have all the same name : row
i would like to know if there is an easy way to find them in my table ?
i was thinking about something like :
$("#grid").find('td:row').each(function(i)
{
 ...
});

when td:row would mean each  having name = row.

is there something like that ?

thx.

A.


[jQuery] Re: Flying clouds like in http://devthought.com/

2009-03-14 Thread ricardobeat


http://devthought.com/projects/mootools/apng/

On Mar 14, 12:29 pm, Grom  wrote:
> Hello.
> I want to add flying clouds like onhttp://devthought.com/on my site.
> Do anyone know how to do that? Maybe any suggestions?


[jQuery] Re: Upgrade to jquery 1.3.2 and the ajax function not work....

2009-03-14 Thread Andrea - Aosta

I apologize for my request: i have try on another MAC and all work
fine My MAMP is crazy... i reinstall


[jQuery] Re: getting data using html attribute

2009-03-14 Thread Alain Roger
thanks a lot, it works... i was looking so complicated thing to do. :-(


On Sat, Mar 14, 2009 at 5:53 PM, mkmanning  wrote:

>
> item[field]
>
> On Mar 14, 9:46 am, Alain Roger  wrote:
> > Hi,
> >
> > i have several html tags with some additional attributes like 'type' or
> > 'abbr'. for example :
> > Language
> >
> > now i have a function which should fill the TD tag of another table based
> on
> > the abbr attribute of my first table (like you can see the TH above).
> > this function looks like that :
> > $.getJSON("lg.php",{ start: 0, offset : 10 },
> > function(data)
> > {
> > $.each(data.records, function(i,item){
> >
> > var o = "";
> >
> > $("#frm_table th").each(function(j){
> >
> > var tp = $(this).attr("type");
> >
> > if (tp != null && tp != "")
> > {
> >   switch (tp)
> > {
> >   case 'selectrow':
> >   o += " > name='rec' value='" + item.id + "'>";
> > break;
> >
> > case 'editabletext':
> > var field =
> > $(this).attr("abbr");
> > o +=  "" + item +"." +
> field
> > + "";
> > break;
> > }
> > }
> > });
> > o += "";
> > $("#data_grid").append(o);
> > });
> >
> > now my problem is that i'm not able to retrieve the item.id or
> item.language
> > of my JSON records when i do:
> > o +=  "" + item +"." + field + "";
> >
> > i guess it's because it is taken as simple string concatenation and does
> not
> > cast it as object.
> > so how can i solve it ?
> > thanks a lot.
> >
> > Alain
>



-- 
Alain
---
Windows XP x64 SP2 / Fedora 10 KDE 4.2
PostgreSQL 8.3.5 / MS SQL server 2005
Apache 2.2.10
PHP 5.2.6
C# 2005-2008


[jQuery] Re: jQuery each problem

2009-03-14 Thread Josh Powell

$(this).is("eq[0]")

will not work because, is looks at the list of jquery objects that $
(this) returns.  Which is just one object.

try giving the input a value of yes or no and doing

if ($(this).val() === 'yes')


On Mar 14, 8:51 am, macgyver47  wrote:
> One more question if this is not abusing your time
> Structure of each question:
>  onclick='q1=1'>Yes
> No
> 
> jQuery('.choix').click(function(e) {
>   $(this).parent().hide();});
>
> as expected your answer hides the content of the question as expected
> How can I know if first (yes) or second (no) button was clicked
> I tried introducing after $(this).parent().hide();    something like
>  if (jQuery(this).is(":eq[0]")) {
>    do something
>     }
> else
> {
> do something}
>
> but it doesn't work !
> Any ideas ?
> Thanks for help
> Jean from France
> On Mar 14, 9:49 am, macgyver47  wrote:
>
> > Thank you very much for a great answer  which nearly solved my
> > question in a very elegant way, I have even discovered in studying
> > selectors a little more thouroughly ( jquery doc)  that you can use
> > jQuery('.choix').click(function(e) {
> > $(this).parent().parent().hide();
> > and it will go 2 levels up instead of one as described in you solution
> > Thanks to great people like you Josh I am learning ( slowly)
> > Many thanks
> > Jean from France
>
> > On 14 mar, 08:27, Josh Powell  wrote:
>
> > > Yes, forget about using ID's in this way.  That's something you had to
> > > do before using jQuery.  Think about how your HTML is structured and
> > > things are named/classed and the order they are in.  Take advantage of
> > > how easy it is to traverse the DOM with jQuery.  If yo uhave
>
> > > 
> > >   link 1
> > >   Description
> > > 
>
> > > 
> > >   link 2
> > >   Description
> > > 
>
> > > 
> > >   link 3
> > >   Description
> > > 
>
> > > and do:
>
> > > jQuery('.choix').click(function(e) {
> > >   $(this).parent().hide();
>
> > > });
>
> > > Then jQuery will iterate through all of the elements on the page with
> > > a class of 'choix' and attach a click event that hides that links
> > > parent when clicked on.  This keeps your html/javascript much cleaner
> > > as you do not even need to worry about assigning incrementing id's to
> > > elements and keeping the numbers matched to another elements id to
> > > link them.
>
> > > This is not an exact solution for you, but it should point you in the
> > > right direction and way of thinking about how to use jQuery.
>
> > > Josh
>
> > > On Mar 13, 11:27 pm, macgyver47  wrote:
>
> > > > What it does:
> > > > jQuery('.choix1').click(function(){
> > > >  jQuery('#quest1').hide();
> > > > When you click on either button related to question 1 it just hides
> > > > the div id="quest1"
> > > > What I would like to do is something like:
> > > > for (i=1; i<=6; i++){
> > > >   $("choix " + i ).click function(){
> > > > $("#quest"+i).hide();
> > > >    }
> > > > So every time user clicks on any radio button with id="choix1" or
> > > > choix2 or choix3... it will hide the related div with id="quest1" or
> > > > quest 2...
> > > > Any ideas
> > > > Thanks for help
> > > > Jean from France
>
> > > > On 14 mar, 00:57, Josh Powell  wrote:
>
> > > > > What this is doing:
>
> > > > > jQuery('.choix1').click(function(){
> > > > >   jQuery('#quest1').hide();
>
> > > > > });
>
> > > > > is looping through every element on the page with a class of 'choix1',
> > > > > so you could either change all of the elements you want to loop though
> > > > > classes to choix and then do
>
> > > > >  jQuery('.choix').click(function(){
> > > > >    jQuery(this).parent().hide();
>
> > > > > });
>
> > > > > Which will loop through them all and then hide them when either yes or
> > > > > no is selected or find some other way of identifying every element
> > > > > that you want to act on.  Perhaps use the name field, or if they are
> > > > > the only radio buttons on the page you can do
>
> > > > > jQuery(':radio') as the selector.
>
> > > > > On Mar 13, 2:45 pm, macgyver47  wrote:
>
> > > > > > Hi
> > > > > > I am new to jQuery and learning slowly
> > > > > > Here is the problem
> > > > > > I have 6 questions each of them has 2 buttons ( yes or no radio
> > > > > > buttons)
> > > > > > When user clicks on 1 answer I would like to hide the entire 
> > > > > > question
> > > > > > I have achieved to do this for 1 question but no success looping
> > > > > > through all 6 questions !
> > > > > >  > > > > > onclick='q1=1'>Yes
> > > > > >  > > > > > onclick='q1=0'>No
> > > > > > 
> > > > > >  > > > > > onclick='q1=1'>Yes
> > > > > >  > > > > > onclick='q1=0'>No
> > > > > > 
> > > > > > ...
> > > > > >  jQuery('.choix1').click(function(){
> > > > > >      jQuery('#quest1').hide();
> > > > > >       });
> > > > > > This works for 1 item but how can I loop through all all of them
> > > > > > Thanks for help
> > > > > > Jean from France


[jQuery] Re: getting data using html attribute

2009-03-14 Thread mkmanning

item[field]

On Mar 14, 9:46 am, Alain Roger  wrote:
> Hi,
>
> i have several html tags with some additional attributes like 'type' or
> 'abbr'. for example :
> Language
>
> now i have a function which should fill the TD tag of another table based on
> the abbr attribute of my first table (like you can see the TH above).
> this function looks like that :
> $.getJSON("lg.php",{ start: 0, offset : 10 },
>         function(data)
>                 {
>                     $.each(data.records, function(i,item){
>
>                         var o = "";
>
>                         $("#frm_table th").each(function(j){
>
>                             var tp = $(this).attr("type");
>
>                             if (tp != null && tp != "")
>                             {
>                               switch (tp)
>                                 {
>                                   case 'selectrow':
>                                       o += " name='rec' value='" + item.id + "'>";
>                                             break;
>
>                                         case 'editabletext':
>                                             var field =
> $(this).attr("abbr");
>                                             o +=  "" + item +"." + field
> + "";
>                                             break;
>                                 }
>                             }
>                         });
>                         o += "";
>                         $("#data_grid").append(o);
>                     });
>
> now my problem is that i'm not able to retrieve the item.id or item.language
> of my JSON records when i do:
> o +=  "" + item +"." + field + "";
>
> i guess it's because it is taken as simple string concatenation and does not
> cast it as object.
> so how can i solve it ?
> thanks a lot.
>
> Alain


[jQuery] Re: Please help me SPEED UP my dev. MySQL => PHP => JSON => AJAX => jQueryUI

2009-03-14 Thread Josh Powell

No, JSON is the correct route.  If you are using ajax to retrieve
json, then you can pull the json into a javascript object
immediately.  If you are using PHP to generate pages, then you can
print out the JSON object as a string directly into javascript and
create javascript objects that way.  jQuery has built in methods
to .getJSON that provides the basis of all my AJAX calls in the web
app I work on.

Another tip, standardize all the JSON responses into a format you
like, for example

{
  'header': {
 'type': String,
 'message': String
  },
  'payload': {
'data': []
  }
}

That way you can create one object that calls .getJSON and use that
object to do all of your ajax calls and have a standard set of
responses to being timed out, 404 errors, loading alert while the ajax
call is running, etc.

Good luck.

On Mar 14, 7:38 am, dani  wrote:
> Before taking on a challenging task, please give me some ideas to
> speed up my development!
>
> Just as the topic is saying, I will primarily be doing: MySQL => PHP
> => JSON => AJAX => jQueryUI
>
> I used to work with CakePHP but I have little experience with JSON.
> Any hints on your favourite tools and helpers (MVC frameworks, MySQL
> tools, JSON parsers, jQuery extensions etc.) are greatly appreciated.
>
> If you think I should modify my "route", for example XML instead of
> JSON, please put forward the pros and cons.
>
> Thanks.


[jQuery] wrap some tag around group of table rows for hide and show

2009-03-14 Thread Lwangaman

Ok let's see if this post works... The last couple tries didn't!

I was reading through this year-old thread which I found googling
since I'm doing something similar, perhaps someone could give me a
couple tips.

Here is the page with the example I'm dealing with:
http://johnrdorazio.altervista.org/SitoFlatnukePersonale/index.php?mod=04_Mia_programmazione/04_Tabelle_con_Jquery

Clicking on the checkboxes, two rows should appear (which were hidden
from the beginning) in which more information can be inserted (that
otherwise would not be necessary).

The only problem is, it seems to work only in Internet Explorer. In
Firefox the rows wind up appearing at the bottom of the table, and
every time you un-click and re-click some mysterious space begins
accumulating. Not only, but the cells of the two appearing rows don't
line up with the cells of all the other rows of the table, the seem to
want to line up with only the first column which really opens up wide
that first column shifting the whole table over to the right. Google
Chrome presents a similar problem, only the appearing rows don't wind
up at the bottom of the table. They stay where they're supposed to be,
but the cells still don't line up and they shift the whole table, and
un-click re-click still creates that mysterious gap.

At first I was applying JQuery directly to the rows that were
involved, then reading this thread I tried creating different "tbody"
sections and applying the JQuery to those sections, but the problems
remain. Perhaps it could be a problem of parent-child relationships?
I'm not sure how those work though, if anyone has any thoughts I would
be very grateful.

Here is my code:




$(document).ready(function(){

$(".showhidesection").hide();
$("#pastoralcounsel").click(function(){
if ($("#pastoralcounsel:checked").val()!=null)
{
$("#represents").show("fast");
}
else
{
$("#represents").hide("fast");
}
});
$("#i_am_a_catechist").click(function(){
if ($("#i_am_a_catechist:checked").val()!=null)
{
$("#catechizes").show("fast");
}
else
{
$("#catechizes").hide("fast");
}
});
$("#volunteer").click(function(){
if ($("#volunteer:checked").val()!=null)
{
$("#volunteers").show("fast");
}
else
{
$("#volunteers").hide("fast");
}
});

});






Cons.
Pastorale



--- -> rappresenta:
...



Catechista



--- -> del
gruppo:
...I^ Anno Comunioni



Volontario parrocchiale


>
--- -> servizio:
...





[jQuery] getting data using html attribute

2009-03-14 Thread Alain Roger
Hi,

i have several html tags with some additional attributes like 'type' or
'abbr'. for example :
Language

now i have a function which should fill the TD tag of another table based on
the abbr attribute of my first table (like you can see the TH above).
this function looks like that :
$.getJSON("lg.php",{ start: 0, offset : 10 },
function(data)
{
$.each(data.records, function(i,item){

var o = "";

$("#frm_table th").each(function(j){

var tp = $(this).attr("type");

if (tp != null && tp != "")
{
  switch (tp)
{
  case 'selectrow':
  o += "";
break;

case 'editabletext':
var field =
$(this).attr("abbr");
o +=  "" + item +"." + field
+ "";
break;
}
}
});
o += "";
$("#data_grid").append(o);
});

now my problem is that i'm not able to retrieve the item.id or item.language
of my JSON records when i do:
o +=  "" + item +"." + field + "";

i guess it's because it is taken as simple string concatenation and does not
cast it as object.
so how can i solve it ?
thanks a lot.

Alain


[jQuery] Re: JSON Newbie

2009-03-14 Thread mkmanning

'aaData' is an array of arrays.
aaData[0][0] = "1001-00-1535.000";
aaData[0][1] = "Tenant Improvements";

On Mar 14, 4:56 am, finco  wrote:
> I'm new to jquery and json.  I've looked at lots of examples of how to
> process json data but they all seem to have field names that come
> across in the data and are used in the foreach processing.  My data
> looks like this:
>
> {"aaData": [
> ["1001-00-1535.000","Tenant Improvements"],
> ["1001-00-1558.000","Selling costs"],
> ["1001-00-1560.000","Financing Fees"],
> ["1001-00-1560.001","Financing Fees - Legal"],
> ["1001-00-5799.000","Bad Debt Expense"],
> ["1001-00-5800.000","Amortization"],
> ["1001-00-5805.000","Depreciation"],
> ["1001-00-.000","Suspense"]
> ]}
>
> I'm trying to drop these two fields into table rows.  Can someone
> point me in the right direction as to how I reference the json data.
>
> Thanks for your help.


[jQuery] Re: Upgrade to jquery 1.3.2 and the ajax function not work....

2009-03-14 Thread Andrea - Aosta

Same problem with the most simple $post wrapper; i have this
javascript function

function anteprima(){

dati = new Array();
dati [0]=tinyMCE.get('txtitaliano').getContent();
dati [1]=$("#paginaitaliano").val();
dati [2]=$("select[name='gmap']").val();
$.post("ad/anteprima.php", { txtitaliano: dati[0],paginaitaliano: dati
[1],gmap: dati[2] } );
}

into the anteprima.php file a simple var_dump($_POST) output this

array(0){
}

But with jquery 1.2.6 the same line in the php file (i.e. var_dump
($_POST)) output the correct post ,

array(3) {
  ["txtitaliano"]=>
  string(11) "txt example"
  ["paginaitaliano"]=>
  string(5) "pagina"
  ["gmap"]=>
  string(1) "0"
}

I have read the documentation but i have not found a tip for manage
the problem


[jQuery] Re: Malsup's Cycle plugin exhibiting strange behavior

2009-03-14 Thread Mike Alsup

> > hi mike,
>
> > i now have replaced my cycle-version with the one you have posted. it
> > seems to work fine now.
> > thanks!
>
> The change I made in 2.58 is not a good x-browser solution.  I'm
> working on something a bit more reliable.
>
> Mike

I think v2.60 is going to be a better solution.  If anyone has time to
test it this weekend I'd appreciate any feedback.  Thanks.

Mike

http://www.malsup.com/jquery/cycle/jquery.cycle.all.2.60.js


[jQuery] Re: jQuery each problem

2009-03-14 Thread macgyver47

One more question if this is not abusing your time
Structure of each question:
Yes
No

jQuery('.choix').click(function(e) {
  $(this).parent().hide();
});
as expected your answer hides the content of the question as expected
How can I know if first (yes) or second (no) button was clicked
I tried introducing after $(this).parent().hide();something like
 if (jQuery(this).is(":eq[0]")) {
   do something
}
else
{
do something
}
but it doesn't work !
Any ideas ?
Thanks for help
Jean from France
On Mar 14, 9:49 am, macgyver47  wrote:
> Thank you very much for a great answer  which nearly solved my
> question in a very elegant way, I have even discovered in studying
> selectors a little more thouroughly ( jquery doc)  that you can use
> jQuery('.choix').click(function(e) {
> $(this).parent().parent().hide();
> and it will go 2 levels up instead of one as described in you solution
> Thanks to great people like you Josh I am learning ( slowly)
> Many thanks
> Jean from France
>
> On 14 mar, 08:27, Josh Powell  wrote:
>
> > Yes, forget about using ID's in this way.  That's something you had to
> > do before using jQuery.  Think about how your HTML is structured and
> > things are named/classed and the order they are in.  Take advantage of
> > how easy it is to traverse the DOM with jQuery.  If yo uhave
>
> > 
> >   link 1
> >   Description
> > 
>
> > 
> >   link 2
> >   Description
> > 
>
> > 
> >   link 3
> >   Description
> > 
>
> > and do:
>
> > jQuery('.choix').click(function(e) {
> >   $(this).parent().hide();
>
> > });
>
> > Then jQuery will iterate through all of the elements on the page with
> > a class of 'choix' and attach a click event that hides that links
> > parent when clicked on.  This keeps your html/javascript much cleaner
> > as you do not even need to worry about assigning incrementing id's to
> > elements and keeping the numbers matched to another elements id to
> > link them.
>
> > This is not an exact solution for you, but it should point you in the
> > right direction and way of thinking about how to use jQuery.
>
> > Josh
>
> > On Mar 13, 11:27 pm, macgyver47  wrote:
>
> > > What it does:
> > > jQuery('.choix1').click(function(){
> > >  jQuery('#quest1').hide();
> > > When you click on either button related to question 1 it just hides
> > > the div id="quest1"
> > > What I would like to do is something like:
> > > for (i=1; i<=6; i++){
> > >   $("choix " + i ).click function(){
> > > $("#quest"+i).hide();
> > >    }
> > > So every time user clicks on any radio button with id="choix1" or
> > > choix2 or choix3... it will hide the related div with id="quest1" or
> > > quest 2...
> > > Any ideas
> > > Thanks for help
> > > Jean from France
>
> > > On 14 mar, 00:57, Josh Powell  wrote:
>
> > > > What this is doing:
>
> > > > jQuery('.choix1').click(function(){
> > > >   jQuery('#quest1').hide();
>
> > > > });
>
> > > > is looping through every element on the page with a class of 'choix1',
> > > > so you could either change all of the elements you want to loop though
> > > > classes to choix and then do
>
> > > >  jQuery('.choix').click(function(){
> > > >    jQuery(this).parent().hide();
>
> > > > });
>
> > > > Which will loop through them all and then hide them when either yes or
> > > > no is selected or find some other way of identifying every element
> > > > that you want to act on.  Perhaps use the name field, or if they are
> > > > the only radio buttons on the page you can do
>
> > > > jQuery(':radio') as the selector.
>
> > > > On Mar 13, 2:45 pm, macgyver47  wrote:
>
> > > > > Hi
> > > > > I am new to jQuery and learning slowly
> > > > > Here is the problem
> > > > > I have 6 questions each of them has 2 buttons ( yes or no radio
> > > > > buttons)
> > > > > When user clicks on 1 answer I would like to hide the entire question
> > > > > I have achieved to do this for 1 question but no success looping
> > > > > through all 6 questions !
> > > > >  > > > > onclick='q1=1'>Yes
> > > > > No
> > > > > 
> > > > >  > > > > onclick='q1=1'>Yes
> > > > > No
> > > > > 
> > > > > ...
> > > > >  jQuery('.choix1').click(function(){
> > > > >      jQuery('#quest1').hide();
> > > > >       });
> > > > > This works for 1 item but how can I loop through all all of them
> > > > > Thanks for help
> > > > > Jean from France


[jQuery] Please help me SPEED UP my dev. MySQL => PHP => JSON => AJAX => jQueryUI

2009-03-14 Thread dani

Before taking on a challenging task, please give me some ideas to
speed up my development!

Just as the topic is saying, I will primarily be doing: MySQL => PHP
=> JSON => AJAX => jQueryUI

I used to work with CakePHP but I have little experience with JSON.
Any hints on your favourite tools and helpers (MVC frameworks, MySQL
tools, JSON parsers, jQuery extensions etc.) are greatly appreciated.

If you think I should modify my "route", for example XML instead of
JSON, please put forward the pros and cons.

Thanks.



[jQuery] Flying clouds like in http://devthought.com/

2009-03-14 Thread Grom

Hello.
I want to add flying clouds like on http://devthought.com/ on my site.
Do anyone know how to do that? Maybe any suggestions?


[jQuery] Re: Force open the search list

2009-03-14 Thread Jonas

I found the solution. I simply did

$('#name').click();

On Mar 14, 3:08 pm, Jonas  wrote:
> I have a text field with autocomplete and now I want to force the list
> of matches to show (like when writing a letter).
>
> Say, the user writes "hello" then unfocus the field. Is it possible to
> add an action to a button so when it's pressed it shows the
> autocompletematches for the field where the user wrote hello?
>
> Something along the lines of
> $('#field').showResults();
> If there isn't a function for it already, how can I add it manually to
> the jquery.autocomplete.js file?


[jQuery] Upgrade to jquery 1.3.2 and the ajax function not work....

2009-03-14 Thread Andrea - Aosta

Width jquery 1.2.6 i have a function as

function get_dati_gerachia(volte){
var chosenItemText = $("select[name='dati_gerarchia']").val();

 a="volte="+volte
+"&id=2&ordine_per=2&pagine=1&master=4&dati="+chosenItemText
+"&livello=3&menu_pagine_aggiunte=6";
 $.ajax({
  type: "POST",
  url:  "ad/dati_gerarchia.php",
  data: a,
  success: function(msg){
.
 And a php function with a



$volte=$_POST['volte'];
$id=$_POST['id'];
. eccc

When i have chenge the jquery 1.2.6 with the 1.3.2 i get an error PHP
Undefined index : volte...

I don't understand the error; i have also set the
dataType:text,
for the ajax js function but i get also the error... My php is 5.2
Thank you


[jQuery] Re: jquery-corner plugin not working anymore?

2009-03-14 Thread Mike Alsup

>     jQuery("#home_start_register_button input").corner();

Are you trying to corner an input element?  I would not expect that to
work.


[jQuery] Re: Is it possible to get the array it is working on?

2009-03-14 Thread Jonas

Hmm it remoevs what I put bwtween [] from the title?
Anyway, the title were supposed to be [autocomplete]Is it possible to
get the array it is working on?

On Mar 14, 10:55 am, Jonas  wrote:
> Or maybe this can be done ina  nicer way, let me explain what i want
> to do
>
> When you enter something in the field and it matches with one of the
> items in the list I want to change the style of the field to bold. I
> tried this
>
> $("#name").result(function(event, data, formatted) {
>   $('#name').css({fontWeight: 'bold'});
>
> });
>
> But it has 2 drawbacks:
> 1. It is only executed if I select the item form the autocompletelist,
> not if the user simply writes exactly the right thing.
> 2. If they select the item and the field gets bold as it should and
> they THEN remove a letter or write more so it no longer matches I want
> to change it back.
>
> Unless there's built in functionality for this the solution I had in
> mind was:
> $("#name").keydown( function(event) {
>   if($("#name").val() in thearray)
>   {
>     make bold
>   }
>   else
>   {
>     make unbold
>   }
>
> }
>
> but then I need a way to fetch the array.


[jQuery] How to play a sound on click and embed a bg sound

2009-03-14 Thread caruso_g

Hi there,
I need to build a website with lot of animations and, if possible,
sound effects. I would like not to use Flash, so for animations I will
user jQuery, but I really don't know how to move for sound fx.
The client would like to have a background sound, and some sound fx on
mousover. Is there any plugin out there to manage this? If not, has
anyone some link to share on how to do that?
Thanks you all in advance.


[jQuery] jquery-corner plugin not working anymore?

2009-03-14 Thread j0llyr0g3r

Hey guys,

i am having trouble with the jquery-corner plugin.

To narrow down my problem i created a really simple example page:

CODE:


  



//

  
  

  

  




What i would have expected:

-> Display of the button with rounded corners

What happens instead:

-> the alert-box is shown
-> i can see that the corners of the button are rounded while my alert-
box is not closed, but after closing the alert-box the corners return
to their old, not-rounded layout

Further information:

- No errors are shown in the javascript error console
- i also tried to put the js-call in the head-section within a
document.ready-block like this:


//

-> no effect, i.e. the corners of the button are rounded while my
alert-box is not closed, but after closing the alert-box they return
to their old, not-rounded layout
- i use FF3 and jquery v1.3.2 and jquery-corners 1.95 (so only the
latest versions)

Any ideas on this?

Any help would be greatly appreciated.


[jQuery] Re: slideDown content disappearing in IE7

2009-03-14 Thread flycast


Sorry. I am actually using the ".toggle()"
-- 
View this message in context: 
http://www.nabble.com/slideDown-content-disappearing-in-IE7-tp22507968s27240p22512801.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: Using " " (or not!)

2009-03-14 Thread Swatchdog

Perfect. Simple. Learning. Thanks.

On Mar 14, 3:53 am, Jack Killpatrick  wrote:
> $("#msgUnits").html(" "); will probably work.
>
> - Jack
>
> Swatchdog wrote:
> > This does not work:
>
> > $("#msgUnits").text( );
>
> > nor does this...
>
> > $("#msgUnits").text(' ');
>
> > I guess   is html only?
>
> > Clues, anyone?


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

2009-03-14 Thread Richard D. Worth
Michael and Anatoly (and anyone else that my be interested), I hope you
consider joining us with your efforts over here:

http://wiki.jqueryui.com/GridTable

Thanks.

- Richard

On Sat, Mar 14, 2009 at 1:19 AM, AnatolyG  wrote:

>
> Michael,
>
> Great job. I built a prototype of my own table for the same reasons a
> few months ago. The grid looks good, but for my purposes (and I am
> sure for many others), while having an array of rows is great and
> useful, the plugin should be able to create such tables from a regular
>  element. I am working on an enterprise app that outputs via
> xslt a table with a bunch of data, and it would be great to run this
> code as a plugin to convert the table (with rules for each column?)
> into a spreadsheet like in your last example. Should be fairly
> straight forward to do that..
>
> I am also looking for sorting (shouldn't be too bad), locking columns,
> locking header (done) and locking footer. I implemented these in my
> prototype already, as well as the rendering from table element.
> Anyway, I would love to help out in some capacity, if you're looking
> to develop this further.
>
> Anatoly
>
> On Mar 9, 5:31 am, Tin  wrote:
> > Hey All,
> >
> > I've been working on a grid/spreadsheet control prototype during the
> > last couple of weeks.  Seeing how there doesn't seem to be a lot of
> > other choices for this sort of thing, I had to write my own.  I've put
> > the project up on Google Code and am looking for experienced
> > developers who can pick this up and turn it into something that
> > everybody can use (a jQuery UI grid plugin?).
> >
> > The project is hosted athttp://code.google.com/p/slickgrid/.
> > Below is a copy of the project home page.
> >
> > Looking forward to your feedback!
> >
> > Michael Leibman
> > michael.leib...@gmail.com
> > Principal Engineer
> > Daptiv Inc.
> >
> >
> --
> >
> > SlickGrid
> >
> > What it is
> >
> > Quite simply, SlickGrid is a JavaScript grid/spreadsheet component.
> >
> > Some highlights:
> >
> > Virtual scrolling/rendering (hundreds of thousands of rows)
> > Extremely fast rendering speed
> > Configurable & customizable
> > Full keyboard navigation
> > Resizable/reorderable columns
> > Custom cell formatters & editors
> > Support for editing and creating new rows.
> > "GlobalEditorLock" to manage concurrent edits in cases where multiple
> > Views on a page can edit the same data.
> > Why?
> >
> > This is pretty much a work-in-progress prototype, so I don't feel like
> > spending a lot of time documenting it at this stage. I do think it is
> > quite promising though, so I'm putting it up for everybody to see and
> > play with. In its current form, it satisfies nearly all of the
> > requirements for the project I am working on where I am utilizing it
> > in an MVC application, so I'm not sure how much time I can afford on
> > turning SlickGrid into something that would work for everybody. If you
> > are willing to help out - let me know, and I'll add you to the project
> > so that you can contribute.
> >
> > Examples
> >
> > Basic use:http://slickgrid.googlecode.com/svn/trunk/example1-simple.html
> >
> > Adding some formatting:
> http://slickgrid.googlecode.com/svn/trunk/example2-formatters.html
> >
> > Turning it into a spreadsheet:
> http://slickgrid.googlecode.com/svn/trunk/example3-editing.html
> >
> > A more comprehensive test page:
> http://slickgrid.googlecode.com/svn/trunk/grid.html
> >
> > Documentation
> >
> > See comments at the top ofhttp://
> slickgrid.googlecode.com/svn/trunk/slick.grid.js.
>


[jQuery] [validate] Hangs jquery after first init of classes (jquery 1.3.2)

2009-03-14 Thread Delifisek Tux
Hello, Following sample code works with older jquery. After moving jquery
1.3.2 and new UI and latest validate code it stops working. If I remove the
validate code works again...


--- following classes are working (eg $("#hucre_ayarlari").click )





1.
NULL
 
123











--- following classes are NOT working (eg $("#hucre_ayarlari").click
)






2.
modul

123







google_analytics




All those html codes are same page. It was very weird bug. First init of
each class selectors was work and after first init. All off them stops
responding.


I had following setup jquery ui and other things loding setup

http://ysp.int/js/libs/jquery/jquery.js";>
http://ysp.int/js/libs/jquery/jquery-ui.js";>

http://ysp.int/js/libs/jquery/plugins/boxy/jquery.boxy.js";
charset="utf-8">







Here My js code

//--- Zebra Rows
$(".drList_bloklar_tr:odd").addClass("bgOdd");
$(".drList_bloklar_tr:even").addClass("bgEven");

//--- Set hover effect
$(".drList_bloklar_tr").hover(function(){
$(this).addClass("bgHover");
},function(){
$(this).removeClass("bgHover");
});

//-- Delete icona basinca
$(".hucre_sil").click(function()  {
hucre_id = this.lang;
answer = confirm('Bu hücreyi silmek istediğinize eminmisiniz ?'); //
Eminmisiniz sorusunu sor
if (answer) {
window.location =
base_url+'blok_duzenleme-1-model-delete-sayfa_id-'+sayfa_id+'-hucre_id-'+hucre_id+'-lokasyon-'+lokasyon+'-istek-'+istek;
// Silme islemini post et.
}
});

$(".hucre_temizle").click(function()  {
hucre_id = this.lang;
answer = confirm('Bu hücrenin içeriğini temizlemek istediğinize
eminmisiniz ?'); // Eminmisiniz sorusunu sor
if (answer) {
window.location =
base_url+'blok_duzenleme-1-model-erase-sayfa_id-'+sayfa_id+'-hucre_id-'+hucre_id+'-lokasyon-'+lokasyon+'-istek-'+istek;
// Silme islemini post et.
}
});

$(".hucre_yukari").click(function()  {
hucre_id = this.lang;
window.location =
base_url+'blok_duzenleme-1-model-hucre_yukari-sayfa_id-'+sayfa_id+'-hucre_id-'+hucre_id+'-lokasyon-'+lokasyon+'-istek-'+istek;
});

$(".hucre_asagi").click(function()  {
hucre_id = this.lang;
window.location =
base_url+'blok_duzenleme-1-model-hucre_asagi-sayfa_id-'+sayfa_id+'-hucre_id-'+hucre_id+'-lokasyon-'+lokasyon+'-istek-'+istek;
});

//--- Kaplan5 Designer Modulunden alinmistir
$(".hucre_ayarlari").click(function(){

hucre_id  = this.lang;
cell_type = this.alt;

$("#designerInterface").html(" ");
if(cell_type == 'NULL') {
content  = col_setup_menu;
boxy_content = ""+content+"<\/div>";
boxy_title   = "Blok Düzenleyici ";

new Boxy(boxy_content,{ title: boxy_title , draggable: true ,
unloadOnHide: true });
$("#designerInterface > #col_types_bdc").ddMenu({ rootTitle: 'Hücre
Türünü Seçiniz' });

$("#designerCellHtml").click(function(){
boxy_content = "<\/textarea><\/form><\/div>";
boxy_title = "Html Editor";
new Boxy(boxy_content,{ title: boxy_title , modal: true ,
unloadOnHide: true });
$("#cell_content").fck({ path: '/js/libs/fckeditor/', toolbar:
'Yasopanel',width: 600,height:300});
});

$(".setupApplication").click(function(){
boxy_content = "Modul Sec"+module_list+"<\/select>Modul Parametreleri<\/textarea><\/form><\/center><\/div>";
boxy_title = "Modül Kurulumu";
new Boxy(boxy_content,{ title: boxy_title , modal: true ,
unloadOnHide: true });
});
}

if(cell_type == 'html') {
cell_content_url =
base_url+'blok_duzenleme-1-islem-getir_html_hucre-istek-ajax-model-getir_hucre-sayfa_id-'+sayfa_id+'-lokasyon-'+lokasyon+'-hucre_id-'+hucre_id;
$.get(cell_content_url, function(data){
boxy_content = ""+data+"<\/textarea><\/form><\/div>";
boxy_title = "Html Editor";
new Boxy(boxy_content,{ title: boxy_title , modal: true ,
unloadOnHide: true });
$("#cell_content").fck({ path: '/js/libs/fckeditor/', toolbar:
'Yasopanel',width: 600,height:300});
});
}
if(cell_type == 'modul') {
cell_content_url =
base_url+'blok_duzenleme-1-islem-getir_html_hucre-istek-ajax-model-getir_hucre-sayfa_id-'+sayfa_id+'-lokasyon-'+lokasyon+'-hucre_id-'+hucre_id;
$.get(cell_content_url, function(data){
boxy_content = data;
boxy_title = "Modül Kurulumu ";
   

[jQuery] [autocomplete] Force open the search list

2009-03-14 Thread Jonas

I have a text field with autocomplete and now I want to force the list
of matches to show (like when writing a letter).

Say, the user writes "hello" then unfocus the field. Is it possible to
add an action to a button so when it's pressed it shows the
autocompletematches for the field where the user wrote hello?


Something along the lines of
$('#field').showResults();
If there isn't a function for it already, how can I add it manually to
the jquery.autocomplete.js file?


[jQuery] [Howto] Validate a form in two part

2009-03-14 Thread xtr3mz

e.g:

  
 
  ...CHECK 1
  
  
 
  ...CHECK 2
  


if I use "ignore: '1' ", It seems not working.

I just want to check a form in 2 part, at different click.


[jQuery] .getJSon

2009-03-14 Thread finco

Sorry if this is a duplicate post - doesn't look like the last one
went through.

I've seen several examples of how to process json data with .each when
the field names come over with json.  My data, howver, looks like the
following:

{"aaData": [
["1001-00-1535.000","Tenant Improvements"],
["1001-00-1558.000","Selling costs"],
["1001-00-1560.000","Financing Fees"],
["1001-00-1560.001","Financing Fees - Legal"],
["1001-00-1565.000","Lease Costs"],
["1001-00-1565.001","Lease Costs -Legal"],
["1001-00-1565.002","Lease Costs - Brokerage"],
["1001-00-1570.000","Legal Fees"]
]}

How would I drop this data into a table?

Thanks in advance for your help.


[jQuery] JSON Newbie

2009-03-14 Thread finco

I'm new to jquery and json.  I've looked at lots of examples of how to
process json data but they all seem to have field names that come
across in the data and are used in the foreach processing.  My data
looks like this:

{"aaData": [
["1001-00-1535.000","Tenant Improvements"],
["1001-00-1558.000","Selling costs"],
["1001-00-1560.000","Financing Fees"],
["1001-00-1560.001","Financing Fees - Legal"],
["1001-00-5799.000","Bad Debt Expense"],
["1001-00-5800.000","Amortization"],
["1001-00-5805.000","Depreciation"],
["1001-00-.000","Suspense"]
]}

I'm trying to drop these two fields into table rows.  Can someone
point me in the right direction as to how I reference the json data.

Thanks for your help.


[jQuery] [ScrollLeft ?]which func is scrollleft

2009-03-14 Thread xtr3mz

var i=1;
function sw(act,id){
  if(act=='in'){
if(i>=1){
 i=i-6;
 $(id).scrollLeft=i;
 var b=setTimeout(function(){sw('left',id);},"10");}
else{
 clearTimeout(b);}
 }
 else{
if(i<410){
 i=i+6;
 $(id).scrollLeft=i;
 var b=setTimeout(function(){sw('right',id);},"10");}
else{
 clearTimeout(b);}
 }
}

just want this scroll in Jquery style.
btw, $(id) is getElementById.

Anyone? thanks  a lot


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

2009-03-14 Thread AnatolyG

Michael,

Great job. I built a prototype of my own table for the same reasons a
few months ago. The grid looks good, but for my purposes (and I am
sure for many others), while having an array of rows is great and
useful, the plugin should be able to create such tables from a regular
 element. I am working on an enterprise app that outputs via
xslt a table with a bunch of data, and it would be great to run this
code as a plugin to convert the table (with rules for each column?)
into a spreadsheet like in your last example. Should be fairly
straight forward to do that..

I am also looking for sorting (shouldn't be too bad), locking columns,
locking header (done) and locking footer. I implemented these in my
prototype already, as well as the rendering from table element.
Anyway, I would love to help out in some capacity, if you're looking
to develop this further.

Anatoly

On Mar 9, 5:31 am, Tin  wrote:
> Hey All,
>
> I've been working on a grid/spreadsheet control prototype during the
> last couple of weeks.  Seeing how there doesn't seem to be a lot of
> other choices for this sort of thing, I had to write my own.  I've put
> the project up on Google Code and am looking for experienced
> developers who can pick this up and turn it into something that
> everybody can use (a jQuery UI grid plugin?).
>
> The project is hosted athttp://code.google.com/p/slickgrid/.
> Below is a copy of the project home page.
>
> Looking forward to your feedback!
>
> Michael Leibman
> michael.leib...@gmail.com
> Principal Engineer
> Daptiv Inc.
>
> --
>
> SlickGrid
>
> What it is
>
> Quite simply, SlickGrid is a JavaScript grid/spreadsheet component.
>
> Some highlights:
>
> Virtual scrolling/rendering (hundreds of thousands of rows)
> Extremely fast rendering speed
> Configurable & customizable
> Full keyboard navigation
> Resizable/reorderable columns
> Custom cell formatters & editors
> Support for editing and creating new rows.
> "GlobalEditorLock" to manage concurrent edits in cases where multiple
> Views on a page can edit the same data.
> Why?
>
> This is pretty much a work-in-progress prototype, so I don't feel like
> spending a lot of time documenting it at this stage. I do think it is
> quite promising though, so I'm putting it up for everybody to see and
> play with. In its current form, it satisfies nearly all of the
> requirements for the project I am working on where I am utilizing it
> in an MVC application, so I'm not sure how much time I can afford on
> turning SlickGrid into something that would work for everybody. If you
> are willing to help out - let me know, and I'll add you to the project
> so that you can contribute.
>
> Examples
>
> Basic use:http://slickgrid.googlecode.com/svn/trunk/example1-simple.html
>
> Adding some 
> formatting:http://slickgrid.googlecode.com/svn/trunk/example2-formatters.html
>
> Turning it into a 
> spreadsheet:http://slickgrid.googlecode.com/svn/trunk/example3-editing.html
>
> A more comprehensive test 
> page:http://slickgrid.googlecode.com/svn/trunk/grid.html
>
> Documentation
>
> See comments at the top 
> ofhttp://slickgrid.googlecode.com/svn/trunk/slick.grid.js.


[jQuery] ajaxQueue

2009-03-14 Thread KierenH

Hi

Trying to understand the ajax queue plugin.
This version: http://view.jquery.com/trunk/plugins/ajaxQueue/jquery.ajaxQueue.js

I am calling ajax methods on a timer, can I rely on ajax queue to run
these?

It seems like ajax queue needs a reference to the last completed ajax
request?

Can someone please show upated usage.

Thanks
Kierenh


[jQuery] [autocomplete] Is it possible to get the array it is working on?

2009-03-14 Thread Jonas

Or maybe this can be done ina  nicer way, let me explain what i want
to do

When you enter something in the field and it matches with one of the
items in the list I want to change the style of the field to bold. I
tried this

$("#name").result(function(event, data, formatted) {
  $('#name').css({fontWeight: 'bold'});
});

But it has 2 drawbacks:
1. It is only executed if I select the item form the autocompletelist,
not if the user simply writes exactly the right thing.
2. If they select the item and the field gets bold as it should and
they THEN remove a letter or write more so it no longer matches I want
to change it back.


Unless there's built in functionality for this the solution I had in
mind was:
$("#name").keydown( function(event) {
  if($("#name").val() in thearray)
  {
make bold
  }
  else
  {
make unbold
  }
}

but then I need a way to fetch the array.


[jQuery] Re: Please need your help

2009-03-14 Thread Hellofrom
Thanks a lot Tim

On Sat, Mar 14, 2009 at 3:29 AM, MonkeyBall2010 wrote:

>
> You should be able to do this very easliy with the validation plugin.
> If the validation rules are exactly the same then you could apply the
> same ID to each form. However, it's most likely that you need specify
> different rules for each form:
>
> (#form1).validate({
> rules: etc.
> messages: etc.
> });
>
> (#form2).validate({
> rules: etc.
> messages: etc.
> }):
>
> On your forms you would specify the proper ID:
>
> 
> 
>
> 
> 
>
> This is an example with two forms:
> http://jquery.bassistance.de/validate/demo/
>
> Tim
>
> On Mar 13, 3:36 pm, Hellofrom  wrote:
> > Hello every one,
> > I need your help , how can i use validation plug in to validate two form
> in
> > the same page
> > thanks
>


[jQuery] Re: help with menu and show/hide divs

2009-03-14 Thread Adam Jessop

Do something like:


first
second
third





 





JS:


$(function(ev) {

$('#links a').click(function(ev){
$('#content div').hide();
id = $(this).attr('id');
$('#' + id + 'Div').show();
);

});



Untested but you get the idea :)

-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of Paul Hutson
Sent: 14 March 2009 11:44
To: jQuery (English)
Subject: [jQuery] Re: help with menu and show/hide divs


Kevin,

You could always go back to basics... i.e. the following (you'll have
to use your existing hide show code..) - and I know this isn't
elegant...

if (ClickedItem == "firstdiv")
{
ShowFirstDiv;
HideSecondDiv;
HideThirdDiv;
} elseif (ClickedItem == "firstdiv") {
HideFirstDiv;
ShowSecondDiv;
HideThirdDiv;
} else {
HideFirstDiv;
HideSecondDiv;
ShowThirdDiv;
};

Regards,
Paul

On Mar 14, 4:02 am, kevinm  wrote:
> I know I am doing something stupid , but can't figure it out.
>
> I have a menu of three items
>
> first
> second
> third
>
> I then have 3 divs
>
> 
> 
>   
>  

[jQuery] Re: help with menu and show/hide divs

2009-03-14 Thread Paul Hutson

Kevin,

You could always go back to basics... i.e. the following (you'll have
to use your existing hide show code..) - and I know this isn't
elegant...

if (ClickedItem == "firstdiv")
{
ShowFirstDiv;
HideSecondDiv;
HideThirdDiv;
} elseif (ClickedItem == "firstdiv") {
HideFirstDiv;
ShowSecondDiv;
HideThirdDiv;
} else {
HideFirstDiv;
HideSecondDiv;
ShowThirdDiv;
};

Regards,
Paul

On Mar 14, 4:02 am, kevinm  wrote:
> I know I am doing something stupid , but can't figure it out.
>
> I have a menu of three items
>
> first
> second
> third
>
> I then have 3 divs
>
> 
>     
>           
>          

[jQuery] Re: jQuery UI... Being integrated into our entire website

2009-03-14 Thread Paul Hutson

Looks good - some of the bits on the site are a bit cheesy, i.e.
"Saving the world... from high priced..." :)

But yeah, the UI is good.

Regards,
Paul

On Mar 14, 3:07 am, K-BL  wrote:
> Thursday I released a new version of a website I manage,
> Cablesforless.com, which takes full advantage of jQuery, a few of it's
> plugins, and UI.  Anyway, what do you guys think?
>
> K-BL


[jQuery] Re: jQuery each problem

2009-03-14 Thread macgyver47

Thank you very much for a great answer  which nearly solved my
question in a very elegant way, I have even discovered in studying
selectors a little more thouroughly ( jquery doc)  that you can use
jQuery('.choix').click(function(e) {
$(this).parent().parent().hide();
and it will go 2 levels up instead of one as described in you solution
Thanks to great people like you Josh I am learning ( slowly)
Many thanks
Jean from France

On 14 mar, 08:27, Josh Powell  wrote:
> Yes, forget about using ID's in this way.  That's something you had to
> do before using jQuery.  Think about how your HTML is structured and
> things are named/classed and the order they are in.  Take advantage of
> how easy it is to traverse the DOM with jQuery.  If yo uhave
>
> 
>   link 1
>   Description
> 
>
> 
>   link 2
>   Description
> 
>
> 
>   link 3
>   Description
> 
>
> and do:
>
> jQuery('.choix').click(function(e) {
>   $(this).parent().hide();
>
> });
>
> Then jQuery will iterate through all of the elements on the page with
> a class of 'choix' and attach a click event that hides that links
> parent when clicked on.  This keeps your html/javascript much cleaner
> as you do not even need to worry about assigning incrementing id's to
> elements and keeping the numbers matched to another elements id to
> link them.
>
> This is not an exact solution for you, but it should point you in the
> right direction and way of thinking about how to use jQuery.
>
> Josh
>
> On Mar 13, 11:27 pm, macgyver47  wrote:
>
> > What it does:
> > jQuery('.choix1').click(function(){
> >  jQuery('#quest1').hide();
> > When you click on either button related to question 1 it just hides
> > the div id="quest1"
> > What I would like to do is something like:
> > for (i=1; i<=6; i++){
> >   $("choix " + i ).click function(){
> > $("#quest"+i).hide();
> >    }
> > So every time user clicks on any radio button with id="choix1" or
> > choix2 or choix3... it will hide the related div with id="quest1" or
> > quest 2...
> > Any ideas
> > Thanks for help
> > Jean from France
>
> > On 14 mar, 00:57, Josh Powell  wrote:
>
> > > What this is doing:
>
> > > jQuery('.choix1').click(function(){
> > >   jQuery('#quest1').hide();
>
> > > });
>
> > > is looping through every element on the page with a class of 'choix1',
> > > so you could either change all of the elements you want to loop though
> > > classes to choix and then do
>
> > >  jQuery('.choix').click(function(){
> > >    jQuery(this).parent().hide();
>
> > > });
>
> > > Which will loop through them all and then hide them when either yes or
> > > no is selected or find some other way of identifying every element
> > > that you want to act on.  Perhaps use the name field, or if they are
> > > the only radio buttons on the page you can do
>
> > > jQuery(':radio') as the selector.
>
> > > On Mar 13, 2:45 pm, macgyver47  wrote:
>
> > > > Hi
> > > > I am new to jQuery and learning slowly
> > > > Here is the problem
> > > > I have 6 questions each of them has 2 buttons ( yes or no radio
> > > > buttons)
> > > > When user clicks on 1 answer I would like to hide the entire question
> > > > I have achieved to do this for 1 question but no success looping
> > > > through all 6 questions !
> > > >  > > > onclick='q1=1'>Yes
> > > > No
> > > > 
> > > >  > > > onclick='q1=1'>Yes
> > > > No
> > > > 
> > > > ...
> > > >  jQuery('.choix1').click(function(){
> > > >      jQuery('#quest1').hide();
> > > >       });
> > > > This works for 1 item but how can I loop through all all of them
> > > > Thanks for help
> > > > Jean from France


[jQuery] Re: New Plugin: jQuery Finder (Mac-style 'Treeview' with Columns)

2009-03-14 Thread Nicolas R

OK fixed now thanks for the tip. onItemSelect should return undefined
rather than false (default setting) to show info.

Unfortunately the API displayed there is 1.2.6, its from
http://api.jquery.com/lib/docs/api-docs.js and its hasn't been updated
for a while.

On Mar 13, 8:34 pm, Nikola  wrote:
> Hi, I noticed that the API browser 
> @http://www.nicolas.rudas.info/jquery/finder/api.html
> isn't displaying the info.  Is it being updated for 1.7 maybe?
> Thanks...
>
> On Mar 5, 5:37 pm, Nicolas R  wrote:
>
> > All right, I added IE6 support.
>
> > Latest files (ui.finder.js,ui.finder-min.js, and ui-finder.ie.css) can
> > be found at the 
> > trunk:http://code.google.com/p/jqueryfinder/source/browse/trunk
>
> > Its not the same as in decent browsers but its good enough.
>
> > On Mar 4, 7:41 pm, Nicolas R  wrote:
>
> > > Matt,
>
> > > I'll get back to you tomorrow with some code snippets. It's been a
> > > while since I did the bug fixing for IE and I can't remember right now
> > > what the issues were. And since I'm really smart I didn't save the
> > > code that fixed the issues. So, yeah, tomorrow I'll have a look and
> > > post back.
>
> > > Cheers
>
> > > On Mar 4, 4:47 pm, matt  wrote:
>
> > > > Hi Nicolas
>
> > > > first, its a great tool to work with!
>
> > > > Currently I'm trying to use it in Plone CMS as a reference widget.
> > > > It works great on nearly all browser (as you said) except on IE6.
>
> > > > My approach was to give fixed height and width to the div's (.ui-
> > > > finder-column, .ui-finder-wrapper):
> > > > but without happy-end -.-
>
> > > > """
> > > > I figured out how to make it work on IE6 (mostly), but as the changes
> > > > are very specific I did not include them in the code. If anyone
> > > > requires ie6 support just ask.
> > > > """
>
> > > > So here I am and I'm asking for support :-)
> > > > a few code snips should be enough.
>
> > > > Thanks in advance
> > > > best regards
> > > > Matt


[jQuery] Re: [autocomplete] Support for JSON data

2009-03-14 Thread Mr.Rech

That's great! I didn't find any reference to this in the docs neither
in the demo page. On IRC I was told that no support for JSON was
available, sorry. You said there will be an autocomplete widget for
jquery-ui, may I ask you when? Sorry for my naive question but I'm
pretty new to all jquery framework.

On Mar 13, 3:19 pm, Jörn Zaefferer 
wrote:
> Its possible to use 
> JSON:http://dev.jquery.com/view/trunk/plugins/autocomplete/demo/json.html
>
> The jQuery UI autocomplete widget will have much better support.
>
> Jörn
>
> On Fri, Mar 13, 2009 at 1:44 PM, Mr.Rech  wrote:
>
> > Have you ever considered to add support for JSON data format to the
> > autocomplete plugin?
>
> > Many other autocomplete-like plugin does support this data format, but
> > this one is (imho) still the best at doing its job. It's a pity that
> > it doesn't support JSON.
>
> > Cheers,
> >  Andrea


[jQuery] Re: Using " " (or not!)

2009-03-14 Thread Jack Killpatrick


$("#msgUnits").html(" "); will probably work.

- Jack

Swatchdog wrote:

This does not work:

$("#msgUnits").text( );

nor does this...

$("#msgUnits").text(' ');

I guess   is html only?

Clues, anyone?

  





[jQuery] Re: Using " " (or not!)

2009-03-14 Thread Josh Powell

$("#msgUnits").text( ); will definitely not work.   is not
the name of a javascript object.

On Mar 13, 9:46 pm, Swatchdog  wrote:
> This does not work:
>
> $("#msgUnits").text( );
>
> nor does this...
>
> $("#msgUnits").text(' ');
>
> I guess   is html only?
>
> Clues, anyone?


[jQuery] Re: jQuery each problem

2009-03-14 Thread Josh Powell

Yes, forget about using ID's in this way.  That's something you had to
do before using jQuery.  Think about how your HTML is structured and
things are named/classed and the order they are in.  Take advantage of
how easy it is to traverse the DOM with jQuery.  If yo uhave


  link 1
  Description



  link 2
  Description



  link 3
  Description


and do:

jQuery('.choix').click(function(e) {
  $(this).parent().hide();
});

Then jQuery will iterate through all of the elements on the page with
a class of 'choix' and attach a click event that hides that links
parent when clicked on.  This keeps your html/javascript much cleaner
as you do not even need to worry about assigning incrementing id's to
elements and keeping the numbers matched to another elements id to
link them.

This is not an exact solution for you, but it should point you in the
right direction and way of thinking about how to use jQuery.

Josh

On Mar 13, 11:27 pm, macgyver47  wrote:
> What it does:
> jQuery('.choix1').click(function(){
>  jQuery('#quest1').hide();
> When you click on either button related to question 1 it just hides
> the div id="quest1"
> What I would like to do is something like:
> for (i=1; i<=6; i++){
>   $("choix " + i ).click function(){
> $("#quest"+i).hide();
>    }
> So every time user clicks on any radio button with id="choix1" or
> choix2 or choix3... it will hide the related div with id="quest1" or
> quest 2...
> Any ideas
> Thanks for help
> Jean from France
>
> On 14 mar, 00:57, Josh Powell  wrote:
>
> > What this is doing:
>
> > jQuery('.choix1').click(function(){
> >   jQuery('#quest1').hide();
>
> > });
>
> > is looping through every element on the page with a class of 'choix1',
> > so you could either change all of the elements you want to loop though
> > classes to choix and then do
>
> >  jQuery('.choix').click(function(){
> >    jQuery(this).parent().hide();
>
> > });
>
> > Which will loop through them all and then hide them when either yes or
> > no is selected or find some other way of identifying every element
> > that you want to act on.  Perhaps use the name field, or if they are
> > the only radio buttons on the page you can do
>
> > jQuery(':radio') as the selector.
>
> > On Mar 13, 2:45 pm, macgyver47  wrote:
>
> > > Hi
> > > I am new to jQuery and learning slowly
> > > Here is the problem
> > > I have 6 questions each of them has 2 buttons ( yes or no radio
> > > buttons)
> > > When user clicks on 1 answer I would like to hide the entire question
> > > I have achieved to do this for 1 question but no success looping
> > > through all 6 questions !
> > >  > > onclick='q1=1'>Yes
> > > No
> > > 
> > >  > > onclick='q1=1'>Yes
> > > No
> > > 
> > > ...
> > >  jQuery('.choix1').click(function(){
> > >      jQuery('#quest1').hide();
> > >       });
> > > This works for 1 item but how can I loop through all all of them
> > > Thanks for help
> > > Jean from France


[jQuery] Re: Working with variable in jquery

2009-03-14 Thread sergiugothic

I made it another way. Probably someone need this code:

$(document).ready(function(){

  $(".adminhead").click(function(){
$(this).toggle("slow");
$(this).parent().find("div.normalmode").toggle("slow");
  });

});