dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #17222
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6782: (patient) Fix bug valueType in Tabular report.
------------------------------------------------------------
revno: 6782
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2012-04-27 16:36:41 +0700
message:
(patient) Fix bug valueType in Tabular report.
modified:
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js 2012-04-27 09:18:31 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js 2012-04-27 09:36:41 +0000
@@ -742,7 +742,25 @@
columns: [],
fields: [],
hidden: [],
- values: []
+ values: [],
+ getValueType: function( index )
+ {
+ if( TR.value.valueTypes[index] == null )
+ {
+ return 'textfield';
+ }
+
+ return TR.value.valueTypes[index].valueType;
+ },
+ getSuggestedValues: function( index )
+ {
+ if( TR.value.valueTypes[index] == null )
+ {
+ return [];
+ }
+
+ return TR.value.valueTypes[index].suggestedValues;
+ }
};
TR.datatable = {
@@ -828,7 +846,7 @@
draggable: true,
emptyText: TR.i18n.et_no_data,
editor: {
- xtype: TR.value.valueTypes[index].valueType,
+ xtype: TR.value.getValueType(index),
queryMode: 'local',
editable: true,
valueField: 'name',
@@ -836,7 +854,7 @@
allowBlank: true,
store: new Ext.data.ArrayStore({
fields: ['name'],
- data: TR.value.valueTypes[index].suggestedValues,
+ data: TR.value.getSuggestedValues(index),
})
}
};
@@ -855,7 +873,7 @@
sortable: false,
draggable: true,
editor: {
- xtype: TR.value.valueTypes[index].valueType,
+ xtype: TR.value.getValueType(index),
queryMode: 'local',
editable: true,
valueField: 'name',
@@ -863,7 +881,7 @@
allowBlank: true,
store: new Ext.data.ArrayStore({
fields: ['name'],
- data: TR.value.valueTypes[index].suggestedValues,
+ data: TR.value.getSuggestedValues(index),
})
}
};