123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- /*******************************************************************************
- * 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 "<div title='"+titleVal+"' class='"+className+"'><span style='visibility:hidden'>"+titleVal+"</span></div>";
- },
- 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 "<div title='"+value+"'>"+value+"</div>";
- }
- },{
- 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 "<div title='"+PDMSG.IPT.IDS_IPT_COLUMN_AGGREGATE_EDIT_HINT+"' class='editableGridCell'>"+value+"</div>"
- } else {
- item.regularAggregateEditable = false;
- return "<div style='visibility:hidden'>"+PDMSG.IPT.IDS_IPT_COLUMN_AGGREGATE_TYPE_UNSUPPORTED+"</div>";
- }
- }
- },{
- itemName: "semiAggregate",
- noresize: true,
- hidden: true
- },{
- itemName: "hidden",
- noresize: true,
- hidden: true
- }
- ]
- });
|