Forum: Typo Ajax in Sidebar Plug-in Admin Interface

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Chris Saylor (Guest)
on 2006-03-21 06:23
(Received via mailing list)
I would like to do drag and drop ordering of information in the admin
section of a plug-in. I tried to define the update method in the
plugin controller, but ajax was unable to call it. Anybody have any
ideas on how I can get this to work. Here is a link to some code.

http://rafb.net/paste/results/I5f5nJ15.html

Right now I'm just trying to get the standard scriptaculous example to
work. I'm not even trying to save the data yet into the config var.

Thanks,
Chris
Piers C. (Guest)
on 2006-03-21 13:14
(Received via mailing list)
"Chris Saylor" <removed_email_address@domain.invalid> writes:

> I would like to do drag and drop ordering of information in the admin
> section of a plug-in. I tried to define the update method in the
> plugin controller, but ajax was unable to call it. Anybody have any
> ideas on how I can get this to work. Here is a link to some code.
>
> http://rafb.net/paste/results/I5f5nJ15.html
>
> Right now I'm just trying to get the standard scriptaculous example to
> work. I'm not even trying to save the data yet into the config var.

Does scriptaculous let you do nested drag and drop?
Chris Saylor (Guest)
on 2006-03-21 15:11
(Received via mailing list)
The drag and drop portion is working fine. It just doesn't communicate
back to the method I have defined in my plugin controller.

What I'm actually trying to do is create a page menu plugin. The drag
and drop is for sorting the pages in the menu. I'm actually thinking
the sorting functionality would be better put in the show pages admin
screen, and the order field stored in the content table. What do you
think?

Thanks,
Chris
Piers C. (Guest)
on 2006-03-21 15:21
(Received via mailing list)
"Chris Saylor" <removed_email_address@domain.invalid> writes:

> The drag and drop portion is working fine. It just doesn't communicate
> back to the method I have defined in my plugin controller.

And it won't do; it's a function of how sidebars work; the only
actions they can respond to are configure and content, and those are
pretty constrained.

> What I'm actually trying to do is create a page menu plugin. The drag
> and drop is for sorting the pages in the menu. I'm actually thinking
> the sorting functionality would be better put in the show pages admin
> screen, and the order field stored in the content table. What do you
> think?

Umm... I've always just used a static sidebar for my links to
pages. If belongs anywhere, it belongs in a plugin rather than
complicating the admin interface any further. But, right now, you
can't do what you want.

When the trac's up, we need to add an "allow sidebar plugins to respond
to more actions than just 'content' and 'configure'" ticket with a
quick discussion of what you're trying to do. Probably marked as for
4.x/5.0 I'm afraid.
Steve L. (Guest)
on 2006-03-21 18:51
(Received via mailing list)
+1  It would be great if sidebars could have more than just the "content
page".  I tried it by updating the DIV via Javascript, but when you
access
the sidebars outside of the controller loaded context things get icky.
Probably why they are so hard to test.
I think if Piers refactored sidebar code comes to be then doing this
will be
a lot easier.
This topic is locked and can not be replied to.