Re: [jQuery] selectable not working after loading content through .load the second time

2007-03-03 Thread Priet

I am as well very interested in the alternate paint method of selecting
objects. Could you maybe e-mail it to [EMAIL PROTECTED]
Thanks!

I'm also having troubles reinitializing the selectables. I have made an
example page: http://www.peterriet.net/temp/selectables. After you reset the
items (or add one) the selecthelper is still working, but nothing can be
selected.

When I call this code again after resetting the HTML nothing happens: still
the items can't be selected:

$('div.msd').Selectable(
{
accept : 'selectableitem',
opacity : 0.2,
selectedclass : 'selecteditem',
helperclass : 'selecthelper'
}
);

Does anyone have an idea on how to solve this? Any help is appreciated.

Kind regards,


Peter Riet


floepi wrote:
 
 Hi Jason,
 
 send you the files to your gmail account. Did you get them ?
 
 Cheers
 
 Phil
 
 
 
 jason schleifer wrote:
 
 Heya phil!
 
 thanks for the feedback!  I noticed it got very slow if I had more than
 20
 items selectable.. which, of course, is what I want to do.. heh :)
 
 I'd  love to try the paint selection, if you've got time to send it my
 way!
 
 cheers!
 -jason
 
 On 12/12/06, floepi [EMAIL PROTECTED] wrote:


 Hi Jason,

 i had the same problem. If you include a script reinitialise
 selectables
 code /script at the end of the data you are loading, it should work. I
 assume that the onsuccess function is called before your newly loaded
 elements are registered in the dom. It is not slick but works.

 By the way - if you have a lot of elements, selectables tends to become
 very
 slow and unusable. Had to write my own version which works like paint
 selection in maya but is much faster. Give me a shout if you wanna try
 that
 at some point.

 Cheers

 Phil







 jason schleifer wrote:
 
  that's what I thought.. so the select command should work just fine..
 
 
  On 12/11/06, Chris Domigan [EMAIL PROTECTED] wrote:
 
 
  and if I go $(#content).load()
  
   does the stuff inside #content get deleted automatically?
 
 
 
  Yes - load() overwrites the contents of the element.
 
  Chris
 
 
 
  ___
  jQuery mailing list
  discuss@jquery.com
  http://jquery.com/discuss/
 
 
 
 
 
  --
  jason schleifer
  ah-ni-may-tor | weirdo
  http://jonhandhisdog.com/
 
  ___
  jQuery mailing list
  discuss@jquery.com
  http://jquery.com/discuss/
 
 

 --
 View this message in context:
 http://www.nabble.com/selectable-not-working-after-loading-content-through-.load-the-second-time-tf2804253.html#a7836677
 Sent from the JQuery mailing list archive at Nabble.com.


 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/

 
 
 
 -- 
 jason schleifer
 ah-ni-may-tor | weirdo
 http://jonhandhisdog.com/
 
 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/selectable-not-working-after-loading-content-through-.load-the-second-time-tf2804253.html#a9286482
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] selectable not working after loading content through .load the second time

2006-12-14 Thread floepi

Hi Jason,

send you the files to your gmail account. Did you get them ?

Cheers

Phil



jason schleifer wrote:
 
 Heya phil!
 
 thanks for the feedback!  I noticed it got very slow if I had more than 20
 items selectable.. which, of course, is what I want to do.. heh :)
 
 I'd  love to try the paint selection, if you've got time to send it my
 way!
 
 cheers!
 -jason
 
 On 12/12/06, floepi [EMAIL PROTECTED] wrote:


 Hi Jason,

 i had the same problem. If you include a script reinitialise
 selectables
 code /script at the end of the data you are loading, it should work. I
 assume that the onsuccess function is called before your newly loaded
 elements are registered in the dom. It is not slick but works.

 By the way - if you have a lot of elements, selectables tends to become
 very
 slow and unusable. Had to write my own version which works like paint
 selection in maya but is much faster. Give me a shout if you wanna try
 that
 at some point.

 Cheers

 Phil







 jason schleifer wrote:
 
  that's what I thought.. so the select command should work just fine..
 
 
  On 12/11/06, Chris Domigan [EMAIL PROTECTED] wrote:
 
 
  and if I go $(#content).load()
  
   does the stuff inside #content get deleted automatically?
 
 
 
  Yes - load() overwrites the contents of the element.
 
  Chris
 
 
 
  ___
  jQuery mailing list
  discuss@jquery.com
  http://jquery.com/discuss/
 
 
 
 
 
  --
  jason schleifer
  ah-ni-may-tor | weirdo
  http://jonhandhisdog.com/
 
  ___
  jQuery mailing list
  discuss@jquery.com
  http://jquery.com/discuss/
 
 

 --
 View this message in context:
 http://www.nabble.com/selectable-not-working-after-loading-content-through-.load-the-second-time-tf2804253.html#a7836677
 Sent from the JQuery mailing list archive at Nabble.com.


 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/

 
 
 
 -- 
 jason schleifer
 ah-ni-may-tor | weirdo
 http://jonhandhisdog.com/
 
 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/
 
 

-- 
View this message in context: 
http://www.nabble.com/selectable-not-working-after-loading-content-through-.load-the-second-time-tf2804253.html#a7869318
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] selectable not working after loading content through .load the second time

2006-12-12 Thread floepi

Hi Jason,

i had the same problem. If you include a script reinitialise selectables
code /script at the end of the data you are loading, it should work. I
assume that the onsuccess function is called before your newly loaded
elements are registered in the dom. It is not slick but works. 

By the way - if you have a lot of elements, selectables tends to become very
slow and unusable. Had to write my own version which works like paint
selection in maya but is much faster. Give me a shout if you wanna try that
at some point. 

Cheers

Phil
 






jason schleifer wrote:
 
 that's what I thought.. so the select command should work just fine..
 
 
 On 12/11/06, Chris Domigan [EMAIL PROTECTED] wrote:


 and if I go $(#content).load()
 
  does the stuff inside #content get deleted automatically?



 Yes - load() overwrites the contents of the element.

 Chris



 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/



 
 
 -- 
 jason schleifer
 ah-ni-may-tor | weirdo
 http://jonhandhisdog.com/
 
 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/
 
 

-- 
View this message in context: 
http://www.nabble.com/selectable-not-working-after-loading-content-through-.load-the-second-time-tf2804253.html#a7836677
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] selectable not working after loading content through .load the second time

2006-12-12 Thread jason schleifer

Heya phil!

thanks for the feedback!  I noticed it got very slow if I had more than 20
items selectable.. which, of course, is what I want to do.. heh :)

I'd  love to try the paint selection, if you've got time to send it my way!

cheers!
-jason

On 12/12/06, floepi [EMAIL PROTECTED] wrote:



Hi Jason,

i had the same problem. If you include a script reinitialise selectables
code /script at the end of the data you are loading, it should work. I
assume that the onsuccess function is called before your newly loaded
elements are registered in the dom. It is not slick but works.

By the way - if you have a lot of elements, selectables tends to become
very
slow and unusable. Had to write my own version which works like paint
selection in maya but is much faster. Give me a shout if you wanna try
that
at some point.

Cheers

Phil







jason schleifer wrote:

 that's what I thought.. so the select command should work just fine..


 On 12/11/06, Chris Domigan [EMAIL PROTECTED] wrote:


 and if I go $(#content).load()
 
  does the stuff inside #content get deleted automatically?



 Yes - load() overwrites the contents of the element.

 Chris



 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/





 --
 jason schleifer
 ah-ni-may-tor | weirdo
 http://jonhandhisdog.com/

 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/



--
View this message in context:
http://www.nabble.com/selectable-not-working-after-loading-content-through-.load-the-second-time-tf2804253.html#a7836677
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
jason schleifer
ah-ni-may-tor | weirdo
http://jonhandhisdog.com/
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] selectable not working after loading content through .load the second time

2006-12-11 Thread jason schleifer

Hey folks,

I've got a problem where I'm trying to use the selectable plugin (very cool,
btw) and it isn't working the second time content is loaded onto the page..

here's what's happening.

I have a page that has a list of tags on it.  When the user clicks on a tag,
it loads a series of images from a database and displays them in a div.
By default when you go to the page the script loads the latest images.

At the end of the php script that loads images, I have some code that tells
everything in that div to be a selectable.. it looks like:

script type=text/javascript
   $('#content').Selectable(
   {
   accept: 'preview',
   opacity : 0.2,
   selectedclass: 'selecteditem',
   helperclass: 'selecthelper',
   onselect: function(serial)
   {
   var selected = serial.hash;
   //toggleButtons(1);

   }
   }
   );
   /script

This works as expected and is great.  However, when the user clicks on a tag
and the new set of images loads up (I'm using something like:

$(content .load(./loadImages.php));

the selectable rubberband select box works, but none of the items are
selectable.

I'm guessing that it's trying to run the selectable code before the images
exist.. but even when I do something like:

function applySelectables ()
{
   $('#content').Selectable(
   {
   accept: 'preview',
   opacity : 0.2,
   selectedclass: 'selecteditem',
   helperclass: 'selecthelper',
   onselect: function(serial)
   {
   var selected = serial.hash;
   }
   }
   );

}

   $(#content).load(./showRef.php, function() {
   applySelectables();
   });

it still doesn't work.


I'm not getting any errors returned in the code, so I'm curious if anyone
has any suggestions..

cheers!


--
jason schleifer
ah-ni-may-tor | weirdo
http://jonhandhisdog.com/
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] selectable not working after loading content through .load the second time

2006-12-11 Thread jyl
You need to reapply the functionality each time a new #content element is
created. Presumably you delete and recreate it (I didnt read the code
carefully enough to be sure... :) ).

 Hey folks,

 I've got a problem where I'm trying to use the selectable plugin (very
 cool,
 btw) and it isn't working the second time content is loaded onto the
 page..

 here's what's happening.

 I have a page that has a list of tags on it.  When the user clicks on a
 tag,
 it loads a series of images from a database and displays them in a div.
 By default when you go to the page the script loads the latest images.

 At the end of the php script that loads images, I have some code that
 tells
 everything in that div to be a selectable.. it looks like:

 script type=text/javascript
 $('#content').Selectable(
 {
 accept: 'preview',
 opacity : 0.2,
 selectedclass: 'selecteditem',
 helperclass: 'selecthelper',
 onselect: function(serial)
 {
 var selected = serial.hash;
 //toggleButtons(1);

 }
 }
 );
 /script

 This works as expected and is great.  However, when the user clicks on a
 tag
 and the new set of images loads up (I'm using something like:

 $(content .load(./loadImages.php));

 the selectable rubberband select box works, but none of the items are
 selectable.

  I'm guessing that it's trying to run the selectable code before the
 images
 exist.. but even when I do something like:

 function applySelectables ()
 {
 $('#content').Selectable(
 {
 accept: 'preview',
 opacity : 0.2,
 selectedclass: 'selecteditem',
 helperclass: 'selecthelper',
 onselect: function(serial)
 {
 var selected = serial.hash;
 }
 }
 );

 }

 $(#content).load(./showRef.php, function() {
 applySelectables();
 });

 it still doesn't work.


 I'm not getting any errors returned in the code, so I'm curious if anyone
 has any suggestions..

 cheers!


 --
 jason schleifer
 ah-ni-may-tor | weirdo
 http://jonhandhisdog.com/
 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/




___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] selectable not working after loading content through .load the second time

2006-12-11 Thread jason schleifer

I was re-applying the functionality.. I'm worried that it's trying to apply
it before the content actually gets created..

is there any way to force the order?

and if I go $(#content).load()

does the stuff inside #content get deleted automatically?

On 12/11/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:


You need to reapply the functionality each time a new #content element is
created. Presumably you delete and recreate it (I didnt read the code
carefully enough to be sure... :) ).

 Hey folks,

 I've got a problem where I'm trying to use the selectable plugin (very
 cool,
 btw) and it isn't working the second time content is loaded onto the
 page..

 here's what's happening.

 I have a page that has a list of tags on it.  When the user clicks on a
 tag,
 it loads a series of images from a database and displays them in a div.
 By default when you go to the page the script loads the latest images.

 At the end of the php script that loads images, I have some code that
 tells
 everything in that div to be a selectable.. it looks like:

 script type=text/javascript
 $('#content').Selectable(
 {
 accept: 'preview',
 opacity : 0.2,
 selectedclass: 'selecteditem',
 helperclass: 'selecthelper',
 onselect: function(serial)
 {
 var selected = serial.hash;
 //toggleButtons(1);

 }
 }
 );
 /script

 This works as expected and is great.  However, when the user clicks on a
 tag
 and the new set of images loads up (I'm using something like:

 $(content .load(./loadImages.php));

 the selectable rubberband select box works, but none of the items are
 selectable.

  I'm guessing that it's trying to run the selectable code before the
 images
 exist.. but even when I do something like:

 function applySelectables ()
 {
 $('#content').Selectable(
 {
 accept: 'preview',
 opacity : 0.2,
 selectedclass: 'selecteditem',
 helperclass: 'selecthelper',
 onselect: function(serial)
 {
 var selected = serial.hash;
 }
 }
 );

 }

 $(#content).load(./showRef.php, function() {
 applySelectables();
 });

 it still doesn't work.


 I'm not getting any errors returned in the code, so I'm curious if
anyone
 has any suggestions..

 cheers!


 --
 jason schleifer
 ah-ni-may-tor | weirdo
 http://jonhandhisdog.com/
 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/




___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
jason schleifer
ah-ni-may-tor | weirdo
http://jonhandhisdog.com/
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] selectable not working after loading content through .load the second time

2006-12-11 Thread Chris Domigan

and if I go $(#content).load()

does the stuff inside #content get deleted automatically?




Yes - load() overwrites the contents of the element.

Chris
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] selectable not working after loading content through .load the second time

2006-12-11 Thread jason schleifer

that's what I thought.. so the select command should work just fine..


On 12/11/06, Chris Domigan [EMAIL PROTECTED] wrote:



and if I go $(#content).load()

 does the stuff inside #content get deleted automatically?



Yes - load() overwrites the contents of the element.

Chris



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/






--
jason schleifer
ah-ni-may-tor | weirdo
http://jonhandhisdog.com/
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/