E
Eric Langland [MS]
Hey Folks,
I have some JScript embedded inside a button click event handler. I want the
button click to add a new item at the top of the form. My code adds a new
item just fine but it adds it at the bottom. I want the new blank item to be
at the top. The code below doesn't throw an error, it just doesn't move the
new item to the top. Not sure why. Any help would be much appreciated.
XDocument.View.ExecuteAction("xCollection::insert", "group2_1");
var parent =
XDocument.DOM.selectSingleNode("/my:myFields/my:group1/my:group2")
XDocument.View.SelectNodes(parent)
var node = parent.childNodes[parent.childNodes.length - 1];
parent.insertBefore(node, parent.childNodes[0]);
I have some JScript embedded inside a button click event handler. I want the
button click to add a new item at the top of the form. My code adds a new
item just fine but it adds it at the bottom. I want the new blank item to be
at the top. The code below doesn't throw an error, it just doesn't move the
new item to the top. Not sure why. Any help would be much appreciated.
XDocument.View.ExecuteAction("xCollection::insert", "group2_1");
var parent =
XDocument.DOM.selectSingleNode("/my:myFields/my:group1/my:group2")
XDocument.View.SelectNodes(parent)
var node = parent.childNodes[parent.childNodes.length - 1];
parent.insertBefore(node, parent.childNodes[0]);