/******************************************************************************* * IBM Confidential * * OCO Source Materials * * A and PM: PD * * (c) Copyright IBM Corp. 2014 * * The source code for this program is not published or otherwise divested of * its trade secrets, irrespective of what has been deposited with the U.S. * Copyright Office. ******************************************************************************/ define(["pd/i18n"], function() { return [ { itemName: "usage", noresize: true, hidden: false, width: dojo.isSafari?"26px":"16px", label: " ", formatter: function(value){ var titleVal = (value == "fact")? PDMSG.IPT.IDS_IPT_COLUMN_USAGE_TYPE_FACT : PDMSG.IPT.IDS_IPT_COLUMN_USAGE_TYPE_ATTRIBUTE; var className = (value == "fact")? "factGridCell" : "attributeGridCell"; return "
"+titleVal+"
"; }, listener: { itemName: "regularAggregate", map: [{unsupported: "attribute"}], defaultValue: "fact" } },{ itemName: "name", noresize: false, hidden: false, width: "100%", label: PDMSG.IPT.IDS_IPT_SPEC_LABEL_COLUMN_NAME, editable: false, formatter: function(value){ return "
"+value+"
"; } },{ itemName: "ID", noresize: true, hidden: true, },{ itemName: "simpletype", noresize: false, hidden: false, width: "60px", label: PDMSG.IPT.IDS_IPT_SPEC_LABEL_DATA_TYPE, formatter: function (data) { var valueLabelMap = { "integer": PDMSG.IPT.IDS_IPT_COLUMN_DATA_TYPE_INTEGER, "text": PDMSG.IPT.IDS_IPT_COLUMN_DATA_TYPE_TEXT, "date": PDMSG.IPT.IDS_IPT_COLUMN_DATA_TYPE_DATE, "datetime": PDMSG.IPT.IDS_IPT_COLUMN_DATA_TYPE_DATETIME, "time": PDMSG.IPT.IDS_IPT_COLUMN_DATA_TYPE_TIME, "decimal": PDMSG.IPT.IDS_IPT_COLUMN_DATA_TYPE_DECIMAL, "boolean": PDMSG.IPT.IDS_IPT_COLUMN_DATA_TYPE_BOOLEAN }; return valueLabelMap[data.toLowerCase()]; } },{ itemName: "regularAggregate", noresize: false, label: PDMSG.IPT.IDS_IPT_SPEC_LABEL_REGULAR_AGGREGATE, width: "100px", hidden: false, editable: true, type: "pd.widgets.grid.cells.Select", options: [ PDMSG.IPT.IDS_IPT_COLUMN_AGGREGATE_TYPE_SUM, PDMSG.IPT.IDS_IPT_COLUMN_AGGREGATE_TYPE_AVERAGE, PDMSG.IPT.IDS_IPT_COLUMN_AGGREGATE_TYPE_MAXIMUM, PDMSG.IPT.IDS_IPT_COLUMN_AGGREGATE_TYPE_MINIMUM, PDMSG.IPT.IDS_IPT_COLUMN_AGGREGATE_TYPE_COUNT, PDMSG.IPT.IDS_IPT_COLUMN_AGGREGATE_TYPE_UNSUPPORTED ], values: ["sum", "average", "maximum", "minimum", "count", "unsupported"], formatter: function (data, rowIndex, scope) { var item = scope.grid.getItem(rowIndex); var factTypes = ["Integer","Decimal"]; var value = scope.options[scope.values.indexOf(data)]; //override the default editable if (factTypes.indexOf(item.simpletype) > -1) { item.regularAggregateEditable = true; return "
"+value+"
" } else { item.regularAggregateEditable = false; return "
"+PDMSG.IPT.IDS_IPT_COLUMN_AGGREGATE_TYPE_UNSUPPORTED+"
"; } } },{ itemName: "semiAggregate", noresize: true, hidden: true },{ itemName: "hidden", noresize: true, hidden: true } ] });