[Proto-Scripty] Re: Problem with the sortable system

2008-10-28 Thread Benjamin


I tried replacing the reload() function by :
function reload()
{
var ul= $('my_ul');
ul.update('li id=li_3test 3/lili id=li_4test 4/li');
}

without any success.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Problem with the sortable system

2008-10-28 Thread Benjamin

Well I also tried it earlier, but I tried again and it's not working :

function reload()
{
text = file('ajax.php?action=reload');
if (text != 0)
writediv(texte, 'my_ul');
}


and the ajax.php file :

if ($_GET['action'] == 'test')
{
echo 'li id=li_3test 3/lili id=li_4test 4/li';
echo 'script type=text/javascript';
echo Sortable.create('my_ul', {
onChange:function(){
alert(Sortable.sequence('my_ul').join(''));
}
});;
echo '/script';
}


any other guesses?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Problem with the sortable system

2008-10-28 Thread T.J. Crowder

Hi,

What does writediv do?  Does it eval scripts?  If not...

Try putting together a complete, but very small, example showing the
problem and posting it to Pastie[1].  You'll probably figure out the
problem in the process of doing that.  If not, it gives people
something to look at.  I'd be very surprised if it's not as simple as
just recreating the Sortable, you just have to be sure the code doing
it gets executed.  Ajax.Updater[2] or Element.update[3] might help.

[1] http://pastie.org
[2] http://prototypejs.org/api/ajax/updater
[3] http://prototypejs.org/api/element/update

FWIW,
--
T.J. Crowder
tj / crowder software / com

On Oct 28, 1:57 pm, Benjamin [EMAIL PROTECTED] wrote:
 Well I also tried it earlier, but I tried again and it's not working :

 function reload()
 {
         text = file('ajax.php?action=reload');
         if (text != 0)
                 writediv(texte, 'my_ul');

 }

 and the ajax.php file :

 if ($_GET['action'] == 'test')
 {
         echo 'li id=li_3test 3/lili id=li_4test 4/li';
         echo 'script type=text/javascript';
         echo Sortable.create('my_ul', {
                         onChange:function(){
                         alert(Sortable.sequence('my_ul').join(''));
                 }
                 });;
         echo '/script';

 }

 any other guesses?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Problem with the sortable system

2008-10-28 Thread T.J. Crowder

LOL Glad I could help.

-- T.J.

On Oct 28, 3:24 pm, Benjamin [EMAIL PROTECTED] wrote:
 Damn you T.J. Crowder I love you ! You solved the problem I had for
 like a week !

 Here's a simple example :
 head
 titleSortable list/title
 script src=lib/prototype.js type=text/javascript/script
 script src=src/scriptaculous.js type=text/javascript/script
 script type=text/javascript
 function test()
 {
         $('my_ul').update('li id=li_3li 3/lili id=li_4li 4/li');
         Sortable.create('my_ul', {
         onChange:function(){
                 alert(Sortable.sequence('my_ul').join(''));
         }
         });}

 /script
 /head
 body
 ul id=my_ul
         li id=li_1li 1/li
     li id=li_2li 2/li
     script type=text/javascript
         Sortable.create('my_ul', {
         onChange:function(){
                 alert(Sortable.sequence('my_ul').join(''));
         }
         });
     /script
 /ul
 a href=# onclick=test()Change it!/a
 /body
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---