onInsertRow..

hi.

I don't know why the _order value is NaN.

var prt = typeof(parent.document.item) == "object" ? parent.document : parent.parent;
var tmpThisItem = typeof(parent.document.thisItem) == "object" ? parent.document.thisItem : parent.thisItem;
var NewRels = prt.item.selectNodes("Relationships/Item[@type='" + relationshipTypeName + "' and @isTemp='1']");
if (!NewRels || NewRels.length < 2)
top.aras.getItemRelationshipsEx(prt.item, relationshipTypeName);

var maxVal = 0;
var rels = tmpThisItem.getRelationships(relationshipTypeName);
var count = rels.getItemCount();
for (var i = 0; i < count; i++) {
var rel = rels.getItemByIndex(i);
var _order = parseInt(rel.getProperty("_order"));
alert(_order);
if (_order > maxVal) {
maxVal = _order;
}
}

var thisRel = tmpThisItem.getItemsByXPath("//Item[@id='" + relationshipID + "']").getItemByIndex(0);
thisRel.setProperty("_order", maxVal + 1);
grid.items_Experimental.set(relationshipID, "value", "_order", maxVal + 1);

Parents Reply Children
No Data