21 Mar 2007 4:47 PM #1
Ext Template to insert DOM nodes rather than strings?
I found myself in need of the ability to use a template in a way that sometimes, one of the substitutions could be the inclusion of an existing element. Specifically, I want to insert a hyperlink node into the template.
I'll solve the problem for now by inserting theLink.outerHTML, but this might lose any behaviors that were attached to the element?
I'm wondering how hard it would be to allow Templates to take nodes as parameters. Right now, it can't because the template compiler builds a large array join and assumes each array item will be a string. But if it instead were changed to an X=insertBefore(target, node) followed by X=insertAfter(X, node[i]) statements, I think it could be supported? (The inner function could just check if the thing is already a node, and just return it)
By moraes in forum Community DiscussionReplies: 11Last Post: 18 Dec 2012, 4:55 AM
By willogee in forum Ext 1.x: Help & DiscussionReplies: 1Last Post: 28 Feb 2008, 6:57 AM
By aconran in forum Ext 1.x: Help & DiscussionReplies: 14Last Post: 13 Mar 2007, 11:48 AM
By fuzzymonk in forum Sencha CmdReplies: 0Last Post: 8 Mar 2007, 6:19 AM
By saravanan in forum Ext 1.x: Help & DiscussionReplies: 1Last Post: 4 Mar 2007, 2:58 PM