[Proto-Scripty] Newbie Question

2009-01-07 Thread Drakhul
I am very new to Prototype and JavaScript, so this is prolly a no- brainer for most of you. Let me see if I can make sense... On my page, there is a DIV where my ajax calls load pages. The main page loads with a specific form loaded in the div. The user clicks a link that calls another page

[Proto-Scripty] making draggable ghost disappear on successful drop

2009-01-07 Thread chris.drappier
Hi All, I have a draggable element that looks like this: [code] %= draggable_element issue_link_#{link.id}, :handle = 'handle', :revert = 'failure', :ghosting = 'true' % [/code] and a drop receiving element that looks like this: [code] %= drop_receiving_element parent_category_issues,

[Proto-Scripty] Using class variables from callbacks.

2009-01-07 Thread David
I'm having a problem where I can't access variables of the main class from callbacks. It seems like I should have to use a keyword like parent or something, but that didn't work. Any thoughts on this? //Sample Code var Controller = Class.create({ initialize: function() { //This variable

[Proto-Scripty] New use case for Sortable tree?

2009-01-07 Thread Eric
I am using Sortable with tree enabled on a list like below: Group 1 Item 1 Item 2 Item 3 Group 2 Item 4 Here, both Groups and Items can be dragged. Additionally, Items can be dragged into Groups (each Group contain an UL). However, I want to prevent Groups from

[Proto-Scripty] Re: Using class variables from callbacks.

2009-01-07 Thread T.J. Crowder
Hi David, JavaScript handles this differently from other languages you may be familiar with. It's set by the calling code; it's not in any way intrinsic to the function itself. Here are a couple of links; the first is a general (and I hope thorough) explanation of what's happening and how to

[Proto-Scripty] Re: dynamic form input options?

2009-01-07 Thread T.J. Crowder
Hi Ryan, What you'll want to do is: 1. Read up on the DOM and how to manipulate it. Most things are Nodes or Elements (Element being a subclass of Node), and you can add and remove Nodes and Elements at runtime via JavaScript using DOM manipulation functions. There's also a non-standard

[Proto-Scripty] Form labels inside inputs with Prototype

2009-01-07 Thread Colorblind
Hy all, I have the following script, works perfectly in Firefox 2/3, but I’m having a problem with IE7 on WinXP. The text in the label tags remains visible next to each form field, and the labels within the form fields don’t appear at first — they show up only after tabbing through them (or

[Proto-Scripty] Re: how can i turn on the inplaceeditor from javascript?

2009-01-07 Thread Niko Schwarz
i was realizing that i am redrawing large parts of the app anyway, so i came up with something like |editor| editor:= self inPlaceEditorOn:html. self isEditModeOnAndRest ifTrue: [ editor call: 'enterEditMode' ]. ^ editor. i am redrawing a little much currently, 33 ms respond time on

[Proto-Scripty] what does a new Ajax get request in Rails return and how do i manipulate it?

2009-01-07 Thread Ram
Hi, Im making an Ajax get request in my Rails application. This is the JS code. function taxes() { var id_1 = $('tax_1').value; var url = '/taxes/tax_name/'+encodeURIComponent(id_1); var tax_1 = new Ajax.Request(url, { asynchronous: true, evalScripts: true,

[Proto-Scripty] Re: what does a new Ajax get request in Rails return and how do i manipulate it?

2009-01-07 Thread T.J. Crowder
Hi Ram, The new operator creates a new object. You're assigning that object to the variable tax_1, and then passing that into Element#update. That's why you're getting [object] in your output. Most times, you don't need to use the object you're creating. To manipulate the results of a

[Proto-Scripty] Dragging in script.aculo.us, intermittant sticking

2009-01-07 Thread Wyerarch
Hi All, I wondered whether anyone had experienced anything similar to this? When I am dragging an item, sometimes the draggable sticks to the mouse, and you have to click again to let it go, whereas other times, it drags fine, and is released when you let go of the mouse button. I am

[Proto-Scripty] Re: Newbie Question

2009-01-07 Thread Eric
What you need is to have the server side script, in this case DeleteGroupMember.php, return a HTML fragment containing the new list. Ajax.Updater will then automatically insert that fragment into the element lmnt. Prototype has very good documentation on this site:

[Proto-Scripty] Re: event.observe document

2009-01-07 Thread Eric
On Dec 16 2008, 12:23 am, Gabriel Gilini gabr...@usosim.com.br wrote: Since he probably has to watch a group of inputs, observing the document is obviously the better choice. Event propagation isn't a bad thing at all. I think that what Matt has in mind was observing the document and use

[Proto-Scripty] Ajax.Updated DIV seems to still have the same innerHTML...

2009-01-07 Thread Ian R
Hey all! I'm sorry, but I've been butting up against this for a day and a half now, and I'm exhausted. It seems simple. Basically, I'm trying to use the WebKit contenteditable attribute to create a smallish front end for a database... so what I did was put a few divs on the page and then

[Proto-Scripty] Re: Dragging in script.aculo.us, intermittant sticking

2009-01-07 Thread Eric
I have experienced some glitches with dragging as well, including the one you are describing. I think it is just that, a glitch. You are not doing anything wrong. What I suggest you to do is to look into the code and see where the glitch is taking place, at least that's what I intend to

[Proto-Scripty] Re: what does a new Ajax get request in Rails return and how do i manipulate it?

2009-01-07 Thread Ram
Hi T.J.Crowder, thanks a lot for your reply! you're telling me that since, in this case, im using the Ajax response immediately to update div elements, it needs to be synchronous.. right? ill do that. i removed the 'new' operator. But Firebug throws this error this.initialize is undefined (line

[Proto-Scripty] how do i pass a form partial as the new HTML element in Element.insert?

2009-01-07 Thread Ram
I have various select boxes for currencies on a page. These can be dynamically added via JS too. As and when the user selects currencies, i need another separate div called test_currencies to get updated with the currency name and the total amount in that particular currency (which requires some