Hi there
I have written one method on event 'onEdit' in this method I am trying to get the value from the source item and splitting it with comma separated and pushing it into the array.
This array needs to be displayed in list format on a relationships grid of property type String for that I have used 'setCombo' API, but its not working. Below is the code for Reference
Please help, Thank u in advance
//To display Text value in list Form.
var inno = top.aras.newIOMInnovator();
var item = parent.thisItem;
var relId = relationshipID;
var relGrid = gridApplet;
var rowcount = relGrid.getRowCount();
var attributeIdIndex = 0;
var attributeValueIndex = 0;
var attributeValueArray = new Array();
var rowID = relGrid.GetSelectedID();
this.grid.selectedCell = this.cell;
getColumnIndexes();
var AttributeName = relGrid.columns_Experimental.get(attributeIdIndex,"name");
var AttributeNameValue = relGrid.items_Experimental.get(relId, "value", AttributeName);
//Query to source Item
var attributeAml = "<AML>"+
"<Item type='pl_attribute' action='get' select='pl_allowed_value_list_item' where=\"[pl_attribute].pl_attribute_name='"+AttributeNameValue+"'\">"+
"</Item>"+
"</AML>";
var attributeAmlResult = inno.applyAML(attributeAml);
var Count = attributeAmlResult.getItemCount();
if(Count == 1)
{
var itemIdx = attributeAmlResult.getItemByIndex(0).getProperty("pl_allowed_value_list_item");
//get values in comma seperated
attributeValueArray = itemIdx.split(",");
//API to convert String datatype Property to list Type and set the value
// relGrid.SetColumnProperties("type=COMBO,list=1",attributeValueIndex);
// attributeValueArray = attributeValueArray.join(relGrid.Delimeter);
// relGrid.cells(rowID,attributeValueIndex).setCombo(attributeValueArray,attributeValueArray);
// var cell = relGrid.cells_Experimental(rowID, attributeValueIndex, true);
// cell.setCellCombo(attributeValueArray, attributeValueArray);
for(var i=0; i < attributeValueArray.length;i++ )
{
var cell = relGrid.cells_Experimental(rowID, attributeValueIndex, true);
cell.setCellCombo(attributeValueArray[i], attributeValueArray[i]);
// relGrid.setCellCombo(rowID, attributeValueIndex, attributeValueArray[i], attributeValueArray[i]);
}
// relGrid.cells(rowID, attributeValueIndex).setCombo(attributeValueArray, attributeValueArray);
}
//******function to get coloumn index******//
function getColumnIndexes()
{
for( var j=0; j< relGrid.GetColumnCount(); j++)
{
var colName = relGrid.GetColumnName(j);
var idx1 = colName.indexOf("pl_attribute_id");
if(parseInt(idx1) >= 0)
{
attributeIdIndex = relGrid.columns_Experimental.get(colName, 'index');
}
var idx2 = colName.indexOf("pl_attribute_value");
if(parseInt(idx2) >= 0)
{
attributeValueIndex = relGrid.columns_Experimental.get(colName, 'index');
}
}
}