[jQuery] Re: Position cursor at end of textbox?

2008-07-02 Thread Paul Malan

Thanks for the code.  It doesn't work for me--still when I tab into a
textbox in either IE7 or FF3 the content is selected and the cursor
isn't positioned at the end of the text, even when I pull out
everything but this function and two textboxes to test.

I think I may just give up--it was a minor detail and not requested by
the users.  Bugs me, though.  Seems like it shouldn't be so tricksy...

On Jul 2, 3:12 pm, "Brian J. Fink" <[EMAIL PROTECTED]> wrote:
> There may be a jQuery way to do this, but I don't know what it is.
>
> However, I do know 2 ways to accomplish this: one DOM way, one IE way.
> Both methods must be employed.
>
> $(function() {
>  $('input[type="text"]').bind('focus',function() {
>   window.o=this;
>   if (o.setSelectionRange)     /* DOM */
>    setTimeout('o.setSelectionRange(o.value.length,o.value.length)',2);
>   else if (o.createTextRange)     /* IE */
>   {
>    var r=o.createTextRange();
>    r.moveStart('character',o.value.length);
>    r.select();
>   }
>  });
>
> });
>
> On Jul 2, 2:55 pm, Paul Malan <[EMAIL PROTECTED]> wrote:
>
> > By default it seems browsers select all the text in a textbox when it
> > gains focus by way of a tab-press.  I would like the cursor to be
> > positioned at the end of any existing text in the input, instead.  The
> > examples I'm turning up on Google don't work and seem needlessly
> > complex, and since jQuery simplifies everything else I used to hate
> > about Javascript, I thought I'd see if there's a simple way to
> > position the cursor in a text input box on focus.  Is it doable?
>
> > Thanks...


[jQuery] Position cursor at end of textbox?

2008-07-02 Thread Paul Malan

By default it seems browsers select all the text in a textbox when it
gains focus by way of a tab-press.  I would like the cursor to be
positioned at the end of any existing text in the input, instead.  The
examples I'm turning up on Google don't work and seem needlessly
complex, and since jQuery simplifies everything else I used to hate
about Javascript, I thought I'd see if there's a simple way to
position the cursor in a text input box on focus.  Is it doable?

Thanks...


[jQuery] return a variable after an ajax call

2007-05-15 Thread Paul Malan

Hi all, I'm sorry if this has been answered before; it seems simpler
than I'm making it.

I am validating a form field on blur by calling a function
validateField.  This function handles the ajax interaction and passes
the response to another function showIcon, which determines which icon
to display and may or may not display an error message div.

This is all working, but now I want to display only the first form
field on load.  The remainder of the form should display only if the
first field passes muster, so I'd simply like to have my validateField
function return true or false.  What could be simpler?  (a lot,
apparently!)

Here is the function.  Is there an easy way to have it return true/
false?  I don't want to interrupt the normal callback handoff to
showIcon, I just want the calling page to have access to the result.

function validateField(file, field, criteria){
$("#"+field+" img.ico").attr("src","/images/office/ico-
loading.gif");
$.get("/gateway/validate-"+file+".cfm",
{field: field, value: $("#"+field+" 
input").val(), criteria:
criteria},
function(response){
response = eval("("+response+")");

showIcon(field,response.pass,response.msg);
});
}



[jQuery] Re: simple use of dimensions plugin

2007-05-09 Thread Paul Malan

Brandon, thanks for the help!   My problem was first that my div was
relative to a containing div instead of the body.  I knew this
couldn't have been so difficult!

Thanks a bunch.



On May 9, 3:10 pm, "Brandon Aaron" <[EMAIL PROTECTED]> wrote:
> You will want to use the offset method to find the top and left values
> of the image and then position the div absolute with those values. The
> offset is calculated from the top, left of the document ... so your
> div will need to be positioned relative to the body tag. Now for the
> code.
>
> var offset = $('#customer_code img.ico').offset();
> $('#myDiv').css(offset);
>
> The offset method returns an object with top and left properties. You
> can pass that object directly into css to set the values.
>
> Let me know if I can help clear anything else up!
>
> --
> Brandon Aaron
>
> On 5/9/07, Paul Malan <[EMAIL PROTECTED]> wrote:
>
>
>
> > I'm sure the dimensions plugin is far less complicated than I think it
> > is, but I'm sick of fighting with it to figure this out.  The visual
> > demo in the svn repository is way over my head.
>
> > I have several status icon images that may be hidden or visible
> > depending on system state.  I need to display a status balloon (much
> > like what you see in Windows XP when you plug in a USB device) next to
> > these icons.
>
> > Essentially, if I have an image $("#customer_code img.ico"), how can I
> > use the dimensions plugin to position another div relative to this
> > image?
>
> > Thanks for any help...



[jQuery] simple use of dimensions plugin

2007-05-09 Thread Paul Malan

I'm sure the dimensions plugin is far less complicated than I think it
is, but I'm sick of fighting with it to figure this out.  The visual
demo in the svn repository is way over my head.

I have several status icon images that may be hidden or visible
depending on system state.  I need to display a status balloon (much
like what you see in Windows XP when you plug in a USB device) next to
these icons.

Essentially, if I have an image $("#customer_code img.ico"), how can I
use the dimensions plugin to position another div relative to this
image?

Thanks for any help...



[jQuery] Re: New plugin: equalize column heights

2007-05-09 Thread Paul Malan

I hope you won't mind that I didn't experiment to learn this answer
for myself, but how does your plugin handle content that expands
within these equalized divs?

For example, if #col2 contains a nested, hidden div, and that div is
shown via jQuery.  I am using a similar solution right now, but if
there is hidden content it leaves a big old gap at the bottom of the
column to accommodate.

Am I making sense?

On May 9, 8:15 am, [EMAIL PROTECTED] wrote:
> I've posted this to the discussion list once before, but now I've put
> together a simple demo page for my equalize column heights plugin:
>
> http://www.tomdeater.com/jquery/equalize_columns/



[jQuery] animate error in IE

2007-04-13 Thread Paul Malan

I'm losing my mind.  This simple little bit of code works a charm in
Firefox and not IE 6/7:

$('#content').animate({className: 'contentNarrow'},1000, function(){
$('#podContainer:hidden').fadeIn(1000);
$("#content").load("screens/order.cfm");
});

The JS error is useless, even using Firebug Lite in IE I can't get any
better detail: Invalid argument on line 1, char 1.

I've eliminated any possible errors involving the callback
functionality--the error remains even without a callback at all.

Any way you can help?

-Paul



[jQuery] Re: table paging and sorting together

2007-04-10 Thread Paul Malan

Jonathan, thanks for taking time to reply with an excerpt from the
book.  I have to assume that for potentially large recordsets my best
bet is to hand off to the server for sorting/paging rather than
storing thousands of rows browser-side.  Would you agree?

On Apr 9, 2:50 pm, Jonathan Chaffer <[EMAIL PROTECTED]> wrote:
> On Apr 6, 2007, at 13:53 , Paul wrote:
>
> > I'm curious how you all handle paged tabular data that also needs
> > to be sortable.  I would typically rely on ajax to retrieve next
> > 25 / previous 25 rows, but if the user can sort any column they
> > want they effectively change what "next 25" means every time they
> > click a column header.  Do I need to abandon the tablesorter plugin
> > and simply use ajax to rebuild the table or is there a better way?
>
> Yes, you pretty much have to do both on the browser or both on the
> server. You can send all the data to the browser and have it paged
> there, or you can perform the sort on the server. Here's a relevant
> excerpt from The Good Book (no not that one):
>
> Sorting and Paging Go Together
>
> Data that is long enough to benefit from sorting is likely long
> enough to be a candidate for paging. It is not unusual to wish to
> combine these two techniques for data presentation. Since they both
> affect the set of data that is present on a page, though, it is
> important to consider their interactions while implementing them.
>
> Both sorting and pagination can be accomplished either on the server
> or in the web browser. We must keep the strategies for the two tasks
> in sync, however. Otherwise, we can end up with confusing behavior.
> Suppose, for example, that both sorting and paging is done on the
> server:
>
>  2509_07_08.png
> 23KViewDownload
>
>
>
> When the table is re-sorted by number, a different set of rows is
> present on page one of the table. If paging is done by the server and
> sorting by the browser, though, the entire data set is not available
> for the sorting routine and so it goes wrong:
>
>  2509_07_09.png
> 13KViewDownload
>
>
>
> Only the data already present on the page can be displayed. To
> prevent this from being a problem, we must either perform both tasks
> on the server, or both in the browser.
>
> --
> Jonathan Chaffer
> Technology Officer, Structure Interactive



[jQuery] Re: table paging and sorting together

2007-04-10 Thread Paul Malan

Matt this looks promising.  I hope you'll let the list know when it's
been adapted to a jQuery plugin!  (And in my experience, sick kids
don't mix well with ANYTHING!)

On Apr 9, 10:47 am, "Matt Kruse" <[EMAIL PROTECTED]> wrote:
> I am trying to finish up my tablesorting/paging/filtering plugin
> here:http://www.JavascriptToolbox.com/lib/table/
> (been trying to finish it up for a while... sick kids don't mix well
> with javascript development free time...)
>
> It works fine withsorting, filtering, andpagingall on the same
> table. It is not in the form of a jQuery plugin yet, but that is my
> next step so that it can be used in a typical jQuery-ish way rather
> than only using the class name approach.
>
> Let me know what you think.
>
> Matt
>
> On Apr 6, 12:53 pm, "Paul" <[EMAIL PROTECTED]> wrote:
>
> > I'm using this table sorter 
> > plugin:http://motherrussia.polyester.se/docs/tablesorter/.
>
> > I'm curious how you all handle paged tabular data that also needs to be
> > sortable.  I would typically rely on ajax to retrieve next 25 / previous 25
> > rows, but if the user can sort any column they want they effectively change
> > what "next 25" means every time they click a column header.  Do I need to
> > abandon the tablesorter plugin and simply use ajax to rebuild the table or
> > is there a better way?
>
> > Thanks for your input.
>
> > Paul



[jQuery] Re: new plugin - columnManager

2007-04-02 Thread Paul Malan

I think I'll give it a shot in a reporting app I'm building, letting
users dynamically show/hide columns that are relevant to the info they
are trying to analyze.  Thanks for your work, Roman!

On Apr 2, 2:25 pm, Roman Weich <[EMAIL PROTECTED]> wrote:
> Andy Matthews schrieb:> Good job Roman! Works great in IE7.
>
> > What types of situations can you see this being used in?
>
> Thanks Andy, I haven't tested it in IE7 yet.
>
> Well, for example...I've a table that is showing a lot of userdata
> (phone numbers, locations, birth dates and some other stuff). Some of
> the users don't want to see all the informations for whatever reasons,
> so I let them decide what they'll get to see. I'm using it with the
> popup window shown in the second table on the demo page.
>
> This is about the only situation I'm seeing it being used. But maybe
> someone will surprise me? :)
>
> Cheers,
> /rw