← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6773: (patient) Upgrate Tabular UI.

 

------------------------------------------------------------
revno: 6773
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2012-04-27 07:59:48 +0700
message:
  (patient) Upgrate Tabular UI.
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties
  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/css/style.css
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/i18n.vm


--
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/resources/org/hisp/dhis/caseentry/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties	2012-04-26 14:59:15 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties	2012-04-27 00:59:48 +0000
@@ -332,4 +332,5 @@
 desc = DESC
 show_hide_columns = Show / Hide columns
 favorites = Favorites
-manage_favorites = Manage favorites
\ No newline at end of file
+manage_favorites = Manage favorites
+update = Update
\ No newline at end of file

=== 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-26 14:59:15 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js	2012-04-27 00:59:48 +0000
@@ -544,6 +544,8 @@
 							TR.datatable.setPagingToolbarStatus();
 							
 							Ext.getCmp('btnReset').enable();
+							Ext.getCmp('btnFilter').enable();
+							Ext.getCmp('btnClean').enable();
 							
 							TR.util.mask.hideMask();
 						}
@@ -583,28 +585,8 @@
 			p.searchingValues = [];
 			if( TR.store.datatable && TR.store.datatable.data.length)
 			{
-				var cols = [];
 				var grid = TR.datatable.datatable;
-				var i = 0;
-				for( var index=0; index<grid.columns.length; index++)
-				{
-					var col = grid.columns[index];
-					if( col.name )
-					{
-						cols[i] = col;
-						i++;
-					}
-					var hidden = col.hidden;
-					var subCols = col.items;
-					for( var subIndex=0; subIndex<subCols.length; subIndex++)
-					{
-						var subCol = subCols.getAt(subIndex);
-						subCol.hidden = hidden ? hidden : subCol.hidden;
-						cols[i] = subCol;
-						i++;
-					}
-				}
-				
+				var cols = grid.columns;
 				var editor = grid.getStore().getAt(0);
 				var colLen = cols.length;
 				for( var i=0; i<colLen; i++ )
@@ -666,19 +648,8 @@
 			
 			if( TR.store.datatable && TR.store.datatable.data.length)
 			{
-				var cols = [];
 				var grid = TR.datatable.datatable;
-				var i = 0;
-				for( var index=1; index<grid.columns.length; index++)
-				{
-					var subCols = grid.columns[index].items;
-					for( var subIndex=0; subIndex<subCols.length; subIndex++)
-					{
-						cols[i] = subCols.getAt(subIndex);
-						i++;
-					}
-				}
-				
+				var cols = grid.columns;
 				var editor = grid.getStore().getAt(0);
 				var colLen = cols.length;
 				for( var i=0; i<colLen; i++ )
@@ -776,6 +747,7 @@
       
     TR.datatable = {
         datatable: null,
+		rowEditing: null,
 		getDataTable: function() {
 			
 			var index = 1;
@@ -785,11 +757,33 @@
 						+ TR.cmp.params.dataelement.selected.store.data.length;
 			var metaDatatColsLen = TR.value.columns.length - paramsLen ;
 			
-			var dgCols = [];
-			var i = 0;
+			// column
+			var cols = [];
+			cols[0] = {
+				header: TR.i18n.no, 
+				dataIndex: 'id',
+				width: 50,
+				height: TR.conf.layout.east_gridcolumn_height,
+				sortable: false,
+				draggable: false,
+				hideable: false,
+				menuDisabled: true
+			};
+			
+			cols[1] = {
+				header: TR.value.columns[1], 
+				dataIndex: 'col1',
+				height: TR.conf.layout.east_gridcolumn_height,
+				name:"meta_1_",
+				sortable: false,
+				draggable: false,
+				hideable: false
+			};
+				
+			index = 2;
 			for( index=2; index < metaDatatColsLen; index++ )
 			{
-				dgCols[i] = {
+				cols[index] = {
 					header: TR.value.columns[index], 
 					dataIndex: 'col' + index,
 					height: TR.conf.layout.east_gridcolumn_height,
@@ -803,11 +797,9 @@
 				i++;
 			}
 			
-			var idenCols = [];
-			i = 0;
 			TR.cmp.params.identifierType.selected.store.each( function(r) {
 				var dataIndex = "col" + index;
-				idenCols[i] = { 
+				cols[index] = { 
 					header: r.data.name, 
 					dataIndex: dataIndex,
 					height: TR.conf.layout.east_gridcolumn_height,
@@ -821,14 +813,11 @@
 					}
 				};
 				index++;
-				i++;
 			});
 			
-			i = 0;
-			var attrCols = [];
 			TR.cmp.params.patientAttribute.selected.store.each( function(r) {
 				var dataIndex = "col" + index;
-				attrCols[i] = { 
+				cols[index] = { 
 					header: r.data.name, 
 					dataIndex: dataIndex,
 					height: TR.conf.layout.east_gridcolumn_height,
@@ -852,14 +841,11 @@
 						}
 					};
 				index++;
-				i++;
 			});
 			
-			i = 0;
-			var deCols = [];
 			TR.cmp.params.dataelement.selected.store.each( function(r) {
 				var dataIndex = "col" + index;
-				deCols[i] = { 
+				cols[index] = { 
 					header: r.data.name, 
 					dataIndex: dataIndex,
 					height: TR.conf.layout.east_gridcolumn_height,
@@ -882,76 +868,9 @@
 					}
 				};
 				index++;
-				i++;
 			});
 			
-						
-			// column
-			var cols = [];
-			
-			cols[0] = {
-				header: TR.i18n.no, 
-				dataIndex: 'id',
-				width: 50,
-				height: TR.conf.layout.east_gridcolumn_height,
-				sortable: false,
-				draggable: false,
-				hideable: false,
-				menuDisabled: true
-			};
-			cols[1] = {
-				header: TR.value.columns[1], 
-				dataIndex: 'col1',
-				height: TR.conf.layout.east_gridcolumn_height,
-				name:"meta_1_",
-				sortable: false,
-				draggable: false,
-				hideable: false
-			};
-				
-			index = 2;
-			if( dgCols.length > 0 )
-			{
-				cols[index]={
-					text: TR.i18n.demographics,
-					isGroupHeader: true,
-					columns: dgCols,
-					menuDisabled: true
-				}
-				index++;
-			}
-			
-			if( idenCols.length > 0 )
-			{
-				cols[index]={
-					text: TR.i18n.identifiers,
-					isGroupHeader: true,
-					columns: idenCols,
-					menuDisabled: true
-				}
-				index++;
-			}
-			
-			if( attrCols.length > 0 )
-			{
-				cols[index]={
-					text: TR.i18n.attributes,
-					isGroupHeader: true,
-					columns: attrCols,
-					menuDisabled: true
-				}
-				index++;
-			}
-			
-			// Data element group header
-			cols[index]={
-				text: TR.i18n.data_elements,
-				isGroupHeader: true,
-				columns: deCols,
-				menuDisabled: true
-			}
-			
-			var rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
+			this.rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
 				clicksToEdit: 1,
 				editStyle: 'row',
 				autoScroll: true,
@@ -990,60 +909,6 @@
 						}
 					}
 				},
-				tbar: [
-					{
-						xtype: 'button',
-						text: TR.i18n.filter,
-						handler: function() {
-							var grid = TR.datatable.datatable;
-							var hidden = grid.getView().getNode(0).classList.contains('hidden');
-							if( hidden )
-							{
-								grid.getView().getNode(0).classList.remove('hidden');
-								var record = grid.getView().getRecord( grid.getView().getNode(0) );
-								grid.getView().getSelectionModel().select(record, false, false);
-								rowEditing.startEdit(0, 0);
-							}
-							else {
-								TR.exe.execute();
-							}
-						}
-					},
-					{
-						xtype: 'button',
-						text: TR.i18n.clear_filter,
-						handler: function() {
-							var cols = [];
-							var grid = TR.datatable.datatable;
-							var i = 0;
-							for( var index=0; index<grid.columns.length; index++)
-							{
-								var col = grid.columns[index];
-								
-								cols[i] = col;
-								i++;
-								
-								var subCols = col.items;
-								for( var subIndex=0; subIndex<subCols.length; subIndex++)
-								{
-									cols[i] = subCols.getAt(subIndex);
-									i++;
-								}
-							}
-							
-							var editor = grid.getStore().getAt(0);
-							var colLen = cols.length;
-							for( var i=1; i<colLen; i++ )
-							{
-								var col = cols[i];
-								var dataIndex = col.dataIndex;
-								TR.store.datatable.first().data[dataIndex] = "";
-							}
-							
-							TR.exe.execute();
-						}
-					}
-				],
 				bbar: [
 					{
 						xtype: 'button',
@@ -1130,7 +995,7 @@
 						}
 					}
 				], 
-				plugins: [rowEditing],
+				plugins: [this.rowEditing],
 				store: TR.store.datatable
 			});
 										
@@ -1314,7 +1179,7 @@
 										style: 'margin-right:8px',
 										width: TR.conf.layout.west_fieldset_width / 2 - 4,
 										format: TR.i18n.format_date,
-										value: new Date(),
+										value: new Date((new Date()).setMonth((new Date()).getMonth()-3)),
 										listeners: {
 											added: function() {
 												TR.cmp.settings.startDate = this;
@@ -2062,68 +1927,107 @@
                         {
                             xtype: 'button',
 							cls: 'tr-toolbar-btn-1',
-                            text: TR.i18n.generate,
+                            text: TR.i18n.update,
 							handler: function() {
                                 TR.exe.execute();
                             }
                         },
 						{
-							xtype: 'button',
-							cls: 'tr-toolbar-btn-2',
-							text: TR.i18n.reset,
-							id:'btnReset',
-							width: 50,
-							disabled: true,
-							listeners: {
-								click: function() {
-									TR.exe.reset();
-								}
-							}
+						xtype: 'button',
+						text: TR.i18n.filter,
+						id: 'btnFilter',
+						disabled: true,
+						handler: function() {
+							var grid = TR.datatable.datatable;
+							var hidden = grid.getView().getNode(0).classList.contains('hidden');
+							if( hidden )
+							{
+								grid.getView().getNode(0).classList.remove('hidden');
+								var record = grid.getView().getRecord( grid.getView().getNode(0) );
+								grid.getView().getSelectionModel().select(record, false, false);
+								TR.datatable.rowEditing.startEdit(0, 0);
+							}
+							else {
+								TR.exe.execute();
+							}
+						}
+					},
+					{
+						xtype: 'button',
+						text: TR.i18n.clear,
+						id: 'btnClean',
+						disabled: true,
+						handler: function() {
+							var grid = TR.datatable.datatable;
+							var cols = grid.columns;
+							var editor = grid.getStore().getAt(0);
+							var colLen = cols.length;
+							for( var i=1; i<colLen; i++ )
+							{
+								var col = cols[i];
+								var dataIndex = col.dataIndex;
+								TR.store.datatable.first().data[dataIndex] = "";
+							}
+							
+							TR.exe.execute();
+						}
+					},
+					{
+						xtype: 'button',
+						cls: 'tr-toolbar-btn-2',
+						text: TR.i18n.reset,
+						id:'btnReset',
+						width: 50,
+						disabled: true,
+						listeners: {
+							click: function() {
+								TR.exe.reset();
+							}
+						}
+					},
+					{
+						xtype: 'button',
+						text: TR.i18n.download + '..',
+						execute: function(type) {
+							TR.exe.execute( type );
 						},
-						{
-                            xtype: 'button',
-                            text: TR.i18n.download + '..',
-                            execute: function(type) {
-								TR.exe.execute( type );
-                            },
-                            listeners: {
-                                afterrender: function(b) {
-                                    this.menu = Ext.create('Ext.menu.Menu', {
-                                        margin: '2 0 0 0',
-                                        shadow: false,
-                                        showSeparator: false,
-                                        items: [
-                                            {
-                                                text: TR.i18n.xls,
-                                                iconCls: 'tr-menu-item-xls',
-                                                minWidth: 105,
-                                                handler: function() {
-                                                    b.execute(TR.conf.finals.image.xls);
-                                                }
-                                            },
-                                            {
-                                                text: TR.i18n.pdf,
-                                                iconCls: 'tr-menu-item-pdf',
-                                                minWidth: 105,
-                                                handler: function() {
-                                                    b.execute(TR.conf.finals.image.pdf);
-                                                }
-                                            }
-                                        ]                                            
-                                    });
-                                }
-                            }
-                        },
-						'->',
-                        {
-                            xtype: 'button',
-							cls: 'tr-toolbar-btn-2',
-                            text: 'Exit',
-                            handler: function() {
-                                window.location.href = TR.conf.finals.ajax.path_commons + TR.conf.finals.ajax.redirect;
-                            }
-                        },
-                    ]
+						listeners: {
+							afterrender: function(b) {
+								this.menu = Ext.create('Ext.menu.Menu', {
+									margin: '2 0 0 0',
+									shadow: false,
+									showSeparator: false,
+									items: [
+										{
+											text: TR.i18n.xls,
+											iconCls: 'tr-menu-item-xls',
+											minWidth: 105,
+											handler: function() {
+												b.execute(TR.conf.finals.image.xls);
+											}
+										},
+										{
+											text: TR.i18n.pdf,
+											iconCls: 'tr-menu-item-pdf',
+											minWidth: 105,
+											handler: function() {
+												b.execute(TR.conf.finals.image.pdf);
+											}
+										}
+									]                                            
+								});
+							}
+						}
+					},
+					'->',
+					{
+						xtype: 'button',
+						cls: 'tr-toolbar-btn-2',
+						text: 'Exit',
+						handler: function() {
+							window.location.href = TR.conf.finals.ajax.path_commons + TR.conf.finals.ajax.redirect;
+						}
+					},]
                 },
                 bbar: {
 					items: [

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/css/style.css'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/css/style.css	2012-04-26 14:31:07 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/css/style.css	2012-04-27 00:59:48 +0000
@@ -684,3 +684,7 @@
 .hidden {
     display: none;
 }
+
+.x-panel-header-default{
+	background: #ffffff !important;
+}

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/i18n.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/i18n.vm	2012-04-26 14:59:15 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/i18n.vm	2012-04-27 00:59:48 +0000
@@ -32,7 +32,7 @@
 data_table:'$encoder.jsEscape($i18n.getString( 'data_table' ) , "'")',
 page:'$encoder.jsEscape($i18n.getString( 'page' ) , "'")',
 loading:'$encoder.jsEscape($i18n.getString( 'loading' ) , "'")',
-generate:'$encoder.jsEscape($i18n.getString( 'generate' ) , "'")',
+update:'$encoder.jsEscape($i18n.getString( 'update' ) , "'")',
 et_no_data:'$encoder.jsEscape($i18n.getString( 'et_no_data' ) , "'")',
 em_no_orgunits:'$encoder.jsEscape($i18n.getString( 'em_no_orgunits' ) , "'")',
 organisation_units:'$encoder.jsEscape($i18n.getString( 'organisation_units' ) , "'")',