myothet
8/18/2017 - 10:13 AM

get_gridApplet.js

function OnInsertKeyPressed() {

    var relationships = document.thisItem.getRelationships();
    var tabbar = parent.relationships.relTabbar;
    var tabID = tabbar.GetSelectedTab();

    var rsTypeItem = myInnovator.getItemById("RelationshipType", tabID);
    var rsName = rsTypeItem.getProperty("name");
    // alert(rsName);

    var relationshipItem = myInnovator.newItem(rsName, "add");
    relationshipItem.setProperty("source_id", document.thisItem.getProperty("id"));
    document.thisItem.addRelationship(relationshipItem);
    document.thisItem.setAttribute("isDirty", "1");

    parent.relationships.iframesCollection[tabID].contentWindow.doSearch(1);

    var ifrm = top.relationships.iframesCollection[tabID];
    var gridApplet = ifrm.contentWindow.grid;
    var count = gridApplet.getRowCount();
    var relationshipID = gridApplet.getRowId(count - 1);

    var x = gridApplet.cells(relationshipID, 0).setValue("XXXXXXXXXX");
}