rubyonrailsin

A Ruby and Rails talk

Monday, March 15, 2010


Re: [Radiant-Dev] Radiant ShopProducts - A bit of PrototypeJS love

by rubyonrailsin 0 comments

Tag


Share this post:
Design Float
StumbleUpon
Reddit

Sorry correction.

What your really trying to do is duplicate what happens when your element not get's clicked, not actually click the element.

What you really are trying to do is duplicate what happens when your element get's clicked. not actually click the element again.

Basically just create one function, and call it from both places.
 
On Mon, Mar 15, 2010 at 10:48 AM, Chris Rankin <rankin.devon@gmail.com> wrote:
DK,

There's not a good way to "click" an element. What you need to do is, extract the code that gets run when the product is clicked and put that it it's own function, instead of being in a behaviour. Then call that function from your behaviour, and also from the Ajax call.

What your really trying to do is duplicate what happens when your element not get's clicked, not actually click the element.

Make sense?






On Mon, Mar 15, 2010 at 3:21 AM, [Square Talent] Dirk Kelly <dirk.kelly@squaretalent.com> wrote:
Hi Guys.

This is really a post for radiant-ecommerce, but I need a wider range of potential readers.

In the interface for the radiant shop products http://github.com/squaretalent/radiant-shop_products-extnesion I have attempted to get the javascript up and going. I've been having a few teething issues and if I could get some advice that would be great.

Fire the click event for first-child
I'd like to have the first anchor within shop_products_list to have its click event fired after the list is repopulated, I'm having zero luck trying to find a way to do this.


General Feedback
If this code is terrible, I'd love to know about it. I'm sure I'm not hitting every best practice, but I am trying to evaluate as much existing code as I go. If you have any advice that would be great.

Cheers,
DK

--
Radiant CMS Dev Mailing List
Post: radiantcms-dev@googlegroups.com
Unsubscribe: radiantcms-dev-unsubscribe@googlegroups.com
Group Site: http://groups.google.com/group/radiantcms-dev/


--
Radiant CMS Dev Mailing List
Post: radiantcms-dev@googlegroups.com
Unsubscribe: radiantcms-dev-unsubscribe@googlegroups.com
Group Site: http://groups.google.com/group/radiantcms-dev/

No comments:

Post a Comment

Subscribe feeds via e-mail

Blog Archive