Add new repeating item with buttonclick

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]);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top