[jQuery] UI Sortable

2008-07-16 Thread armsteadj1

I am having a little trouble with the update callback when i drag an
item from one Sortable to another.. the update function gets called
twice.. is there anyway around this or am i going to need to think of
a way around the 2nd call?

The calls are going to be sending a json array to the backend with the
sort order to update the database and i dont really want that
happening twice.. Thanks!!

James


[jQuery] Re: Sortables Organize

2008-07-16 Thread armsteadj1

Alright, I fixed that problem by taking out the columns and just
changin some css.. now i just need to figure out how to make it so the
large gaps don't get created when a div is bigger or smaller than the
normal size..

On Jul 16, 2:32 pm, armsteadj1 <[EMAIL PROTECTED]> wrote:
> If i have 3 columns that hold 3 divs () each
> and i make those columns sortable by:
>
> $('.column').sortable();
>
> Now if someone moved one of the divs to another column, then that
> column would recieve 4 divs.. is there anyway to make it so the
> sortables would be evened out? so if one column has 4 divs and another
> one has 2 the very bottom div would move down to fill in that spot at
> the bottom?
>
> Example:http://www.myiowa-news.com/test/jquery/sort.html
>
> Would the easiest way to do this be by including in the stop callback
> to count each row and if one row has 2 more than another row then move
> the bottom one over? Thank you!
>
> James


[jQuery] Sortables Organize

2008-07-16 Thread armsteadj1

If i have 3 columns that hold 3 divs () each
and i make those columns sortable by:

$('.column').sortable();

Now if someone moved one of the divs to another column, then that
column would recieve 4 divs.. is there anyway to make it so the
sortables would be evened out? so if one column has 4 divs and another
one has 2 the very bottom div would move down to fill in that spot at
the bottom?

Example: http://www.myiowa-news.com/test/jquery/sort.html

Would the easiest way to do this be by including in the stop callback
to count each row and if one row has 2 more than another row then move
the bottom one over? Thank you!

James


[jQuery] Re: Fadein with ajax load()

2008-07-02 Thread armsteadj1

try:

$('#id-of-my-div').load('somescript.php?name='+escape($(this).val()),
{}).fadeIn("slow");

On Jul 2, 9:35 am, Pickledegg <[EMAIL PROTECTED]> wrote:
> Thanks Equand, unfortunately my fadeIn doesn't seem to have any
> effect. Hmm, maybe its because the contents of the div has already
> been loaded at this point?
>
> Perhaps I'll have to go a bit more technical than just using the load
> method...
>
> On Jul 1, 11:56 pm, Equand <[EMAIL PROTECTED]> wrote:
>
> > try
>
> > $('#id-of-my-div').load('somescript.php?name='+escape($(this).val()),
> > {},function(){ $('#id-of-my-div').fadeIn("slow") 
> > });http://docs.jquery.com/Ajax/load#urldatacallback
>
> > On 1 июл, 14:26, Pickledegg <[EMAIL PROTECTED]> wrote:
>
> > > I'm using an ajax load() with an onChange event:
>
> > > $('#id-of-my-div').load('somescript.php?name='+escape($(this).val()));
>
> > > Which is lovely, but how can I add a fadeIn to it so that every time
> > > my div is updated, it fades into the div in a sultry & provocative
> > > fashion?
>
> > > Thanks.


[jQuery] Re: .submit with ajax inside

2008-07-01 Thread armsteadj1
i just set async to false and that fixed the problem.. i also fixed a
couple other bugs that i noticed in my code along the way.. so if
there is a better way than async:false let me know thanks!

On Jul 1, 10:22 am, DXCJames <[EMAIL PROTECTED]> wrote:
> In the code below It seems that if i uncomment the return true; at the
> bottom it seems to happen before the ajax call is complete.. is there
> anyway to force it to wait for the call or have the call back return
> true or false and have that be returned to the submit's function?
>
>         $("form").bind("submit",function() {
>                 $.ajax({url: "",
>                         cache: false,
>                         type: "POST",
>                         dataType: "json",
>                         data: $("form").serializeArray(),
>                         success: function(data) {
>                                 if(data.ErrorsFound != "") {
>                                         
> $("div#ErrorsFound").text(data.ErrorsFound);
>                                         $("form#register 
> input").each(function(i, element){  $
> (element).removeClass(data.removeClasses); });
>                                         $.each(data.requiredfields, 
> function(i, required) {
>                                                 
> if($("input#"+required.field).hasClass(required.classname) !=
> true) {
>                                                         $
> ("input#"+required.field).addClass(required.classname).focus();
>                                                 }
>                                         });
>                                         return false;
>                                 } else {
>                                         return true;
>                                 }
>                         }
>                 });
>                 if($("div#ErrorsFound").text() == ""){
>                         //return true;
>                 }else{
>                         return false;
>                 }
>          });

[jQuery] Re: X_REQUESTED_WITH ie6

2008-07-01 Thread armsteadj1

hey ken, I tracked it down.. its because of getJSON using the cached
version.. that is what was wrong with mine.. it works fine if you use
$.ajax and with json as the return type and cache to false.. =D

On Jun 28, 1:10 pm, Ken Gregg <[EMAIL PROTECTED]> wrote:
> This may not be an IE6 problem. I have two pages. One page the header
> shows up in php, the other page it doesn't. Using FF3, live headers
> and firebug both say the header is sent. I haven't tried  tracking it
> down yet. Cold be some strange bug somewhere between the browser and
> php. Of course, could be in my code too.
>
> On Jun 27, 8:39 am, DXCJames <[EMAIL PROTECTED]> wrote:
>
> > Since JQuery auto sends "X_REQUESTED_WITH" i assumed it would probably
> > work with most everything.. but it doesnt seem to be working with
> > ie6... I tried changing the head name to a few different things but
> > nothing seemed to work.. does anyone have any idea why this doesnt
> > work or have any other ideas for a similar way to detect if ajax is
> > making the call on the server side? i dont really want to use a
> > QueryString variable because then that allows a person to just open
> > that page up inside the browser.. so i was looking for something
> > slightly more difficult to obtain the page.. any ideas/


[jQuery] binding submit with ajax() inside

2008-07-01 Thread armsteadj1

In the code below if i uncomment the return true; it will
automatically submit the data instead of running the ajax.. is there
anyway to get the $.ajax function to return the true or false value
for the submit function? or have that if statement at the bottom wait
for the $ajax to be done?

$("form#register").bind("submit",function() {
$.ajax({url: "registerajax",
cache: false,
type: "POST",
dataType: "json",
data: $("form#register").serializeArray(),
success: function(data) {
if(data.ErrorsFound != "") {

$("div#ErrorsFound").text(data.ErrorsFound);
$("form#register 
input").each(function(i, element){ $
(element).removeClass(data.removeClasses); });
$.each(data.requiredfields, function(i, 
required) {

if($("input#"+required.field).hasClass(required.classname) !=
true) {
$
("input#"+required.field).addClass(required.classname).focus();
}
});
return true;
} else {
return true;
}
}
});
if($("div#ErrorsFound").text() == ""){
   //return true
}else{
return false;
}
 });


[jQuery] Re: getJSON callback bug

2008-07-01 Thread armsteadj1

It's the format of your json.js

http://www.codejames.com/temp/test.html


On Jul 1, 1:31 pm, Robert O'Rourke <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I think there may be a bug with the getJSON callback function. 
> Seehttp://www.sanchothefat.com/dev/jquery/json/
>
> An alert should show and the body should turn blue if it's successful.
> Using firebug you can see it gets the file. I don't know what's wrong.
> MIME type maybe?
>
> Cheers,
> Rob