Welcome Guest Search | Active Topics | Sign In | Register

treeview after node edit Options
MRmP
Posted: Wednesday, March 7, 2012 10:27:21 AM
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?
eo_support
Posted: Wednesday, March 7, 2012 11:59:30 AM
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.aspx

Make 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!
MRmP
Posted: Thursday, March 8, 2012 6:30:11 AM
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" ?
eo_support
Posted: Thursday, March 8, 2012 8:51:39 AM
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!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.