Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
740
How do I set the value of a webdatatree node using javascript?
posted

I have a slider control and a webdatatree on a page.

when the slider value changes it fires a javascript function that then updates the value of the active node.

it appears to work on the client side as I can put a break right after I call set_valueString for the active node and it returns the the correct new value.

however, on post back, when I spin through the nodes, this node that was edited has a value of "" not the new value and not the original value it had when I first loaded the page.

javascript ---

var oActiveNode = oTree.get_activeNode();
oActiveNode.set_valueString(eventArgs.get_newValue());

is there a different method to set the node value via javascript?

Version=13.2.20132.2028

Parents
  • 740
    Verified Answer
    Offline posted

    In preparing a simple example, I found the issue.

    Since the value I was trying to set the node value to is NOT a string, it ignores it!

    So adding toString() to it works.

    I had:

    oActiveNode.set_valueString(eventArgs.get_newValue());

    I now have:

    oActiveNode.set_valueString(eventArgs.get_newValue().toString());

    and it works.

    Thanks!

    out of curiosity, how are you getting that context menu to appear with the methods - is it in VS2013?

Reply Children
No Data