-
5 Feb 2008 9:00 AM #1
template woes
template woes
Hi all -
I have modified the data-view example and added a onclick event for each image however when the code runs i get a function not defined error. The function is initialized on load. FF shows the onclick event in the image tag but when clicked i get the error.
here is the template code;
Like the H & R tax commerical: "I'm Stuck!".... unlike the H & R tax commerical: "I got people"Code:var tpl = new Ext.XTemplate( '<tpl for=".">', '<div class="thumb-wrap" id="{name}">', '<div class="thumb"><img src="{url}" onclick ="thumbclicked()"title="{url}"></div>', '<span class="x-editable">{ci}</span></div>', '</tpl>', '<div class="x-clear"></div>'
So people... can you help me out
-
6 Feb 2008 4:50 AM #2
Solved template woes
Solved template woes
Hi all - just figured out the problem and the solution.
The problem has nothing to do the the template, but the dataview. I ended up adding a listener to the dataview that picked up the click event and selected the img tag element with the selected id. whats important here is the selection of the parent element of the dataview and only iterate through the images in its heirarchy. if you try to just grab elements by tag name for the document then your id numbers will not correspond to the correct tag heirarchy
Hope this helps


Reply With Quote