Wrapping KitsList and TemplatesList in a div

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
webbspot
Ensign (ENS)
Ensign (ENS)
Posts: 14
Joined: Sat Nov 09, 2013 7:42 am

Wrapping KitsList and TemplatesList in a div

Post by webbspot » Thu Feb 20, 2014 3:02 pm

Hey guys, I am trying to create an onlick event in the product page so that Kit Options and Product Templates will be able to toggle between visible and not. Basically, we use the Kit and Product Templates to show custom options for products, but would like those fields to be hidden until a user clicks a customize button.

I have found the repeaters for those fields in the BuyProductDialog, but have not idea how to wrap them in a div to create the onclick event.

Maybe I am going about this wrong and there is an easier way than trying to use javascript and you could enlighten me on that option as well.

For a reference you can look at this example on our site: http://shop.golfusa.com/Clubs/Drivers/C ... river.aspx

Like I said, we want to hide the technifit logo all the way down to the additional notes unless someone clicks on a customize button.

Any help would be greatly appreciated as always.

David

webbspot
Ensign (ENS)
Ensign (ENS)
Posts: 14
Joined: Sat Nov 09, 2013 7:42 am

Re: Wrapping KitsList and TemplatesList in a div

Post by webbspot » Mon Feb 24, 2014 10:48 am

So I have spent quite a few hours racking my head over this and still have no solution....PLEASE HELP!!! I guess I am going about this all wrong.

Thanks,

David

User avatar
tripleW
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 46
Joined: Wed Oct 30, 2013 5:38 am

Re: Wrapping KitsList and TemplatesList in a div

Post by tripleW » Tue Feb 25, 2014 7:24 pm

Have you tried using OnClientClick with a button to call your javascript function? Here is an example where I'm calling the function named Switch from an ImageButton inside a repeater.

Code: Select all

<asp:Repeater ID="repComponent" OnItemDataBound="repComponent_ItemDataBound" runat="server">
<ItemTemplate>
<asp:Label ID="ComponentProduct" runat="server" Text= '<%# Eval ("Name") %>' > </asp:Label>
<asp:ImageButton ID="imgComponent" 
ImageUrl='<%# "~/assets/" + DataBinder.Eval (Container.DataItem,"Manufacturer") + "/" + DataBinder.Eval (Container.DataItem,"Id") + ".jpg" %>' 
runat="server"  
OnClick="PopupButton_Click" CommandName="DataBinder.Eval (Container.DataItem,'Name')" CommandArgument="popup" 
OnClientClick='<%# "Switch(\"" + DataBinder.Eval (Container.DataItem,"Id") + "\",\"" + DataBinder.Eval (Container.DataItem,"ComponentIndex") + "\",\"" + DataBinder.Eval (Container.DataItem,"KitProductId") + "\" ,\"" + DataBinder.Eval (Container.DataItem,"Name") + "\", \"" + DataBinder.Eval (Container.DataItem,"TotalPrice") + "\");return false;"%>'   />
</ItemTemplate>
</asp:Repeater>
 

webbspot
Ensign (ENS)
Ensign (ENS)
Posts: 14
Joined: Sat Nov 09, 2013 7:42 am

Re: Wrapping KitsList and TemplatesList in a div

Post by webbspot » Mon Mar 03, 2014 6:19 pm

Thanks for your reply! I got it to work with javascript calling for the class instead of the id since it is generated from the .asp compiling code. I am not worth a flip with c# , but can work around html and javascript. Is there a plus or minus to using html and javascript instead of .asp calling the script?

Thanks!

Post Reply