|
Rank: Newbie Groups: Member
Joined: 7/7/2011 Posts: 4
|
Hi.
I'd like to do everything with javascript.
I use ClientSideOnNodeRenaming to remove HTML from the nodes text, so it will appear clean in the textbox the ClientSideOnNodeRename is then used to verify that the user didnt write something he shouldnt (and return true/false based on that)
But now I miss a function to add HTML to the node's text again (ie. <i>node</i>) after a successful submit.
Is this possible?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi, I believe you can call this function: http://www.essentialobjects.com/doc/1/jsdoc.public.navigationitem.settext.aspxMake sure you call it with setTimeout so the actual code will occur AFTER the textbox is already gone. It's something like this:
Code: JavaScript
setTimeout(function()
{
node.setText(your_new_text);
}, 10);
Hope this helps. Please let us know if it works for you. Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 7/7/2011 Posts: 4
|
that worked perfectly, thank you very much!
do you think '10' is sufficient or should I increase it in case of "slow browser-something" ?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
10 should be enough. As soon as node.setText occurs AFTER ClientSideOnNodeRename returns it should be OK. It doesn't really matter after how long.
Thanks!
|
|