Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-timesheet2-weekly
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
project-open
intranet-timesheet2-weekly
Commits
007c22fd
Commit
007c22fd
authored
Mar 31, 2021
by
Project Open
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- WIP: "Sum" column at the very right, right aligned, rounding, ...
parent
25329849
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
10 deletions
+19
-10
index.adp
www/index.adp
+19
-10
No files found.
www/index.adp
View file @
007c22fd
...
...
@@ -75,7 +75,7 @@ function launchTimesheetWeeklyLogging(){
}
});
var sum
mary
Type = function(hourArray, dataIndex) {
var sumType = function(hourArray, dataIndex) {
var sum = 0;
for (var i = 0; i < hourArray.length; i++) {
var vString = hourArray[i].get(dataIndex);
...
...
@@ -85,7 +85,7 @@ function launchTimesheetWeeklyLogging(){
return sum;
};
var sum
mary
Renderer = function(value, summaryData, dataIndex) {
var sumRenderer = function(value, summaryData, dataIndex) {
var type = typeof(value);
if ("number" == type) {
return Math.round(value * 100) / 100;
...
...
@@ -152,13 +152,22 @@ function launchTimesheetWeeklyLogging(){
editor: { xtype: 'pocombotree', store: taskTreeStore, queryMode: 'local', displayField: 'project_name', valueField: 'id'}
},
// { text: "Date", xtype: 'datecolumn', dataIndex: 'day', renderer: Ext.util.Format.dateRenderer('Y-m-d'), editor: {xtype: 'datefield',allowBlank: true}},
{text: "<div align=center>Mon<br>3/29/2021</div>", width: 65, dataIndex: 'hours', editor: { xtype: 'numberfield', minValue: 0}, summaryType: summaryType, summaryRenderer: summaryRenderer},
{text: "<div align=center>Tue<br>3/30/2021</div>", width: 65, dataIndex: 'hours', editor: { xtype: 'numberfield', minValue: 0}, summaryType: summaryType, summaryRenderer: summaryRenderer},
{text: "<div align=center>Wed<br>2/31/2021</div>", width: 65, dataIndex: 'hours', editor: { xtype: 'numberfield', minValue: 0}, summaryType: summaryType, summaryRenderer: summaryRenderer},
{text: "<div align=center>Thu<br>2/31/2021</div>", width: 65, dataIndex: 'hours', editor: { xtype: 'numberfield', minValue: 0}, summaryType: summaryType, summaryRenderer: summaryRenderer},
{text: "<div align=center>Fri<br>2/31/2021</div>", width: 65, dataIndex: 'hours', editor: { xtype: 'numberfield', minValue: 0}, summaryType: summaryType, summaryRenderer: summaryRenderer},
{text: "<div align=center>Sat<br>2/31/2021</div>", width: 65, dataIndex: 'hours', editor: { xtype: 'numberfield', minValue: 0}, summaryType: summaryType, summaryRenderer: summaryRenderer},
{text: "<div align=center>Sun<br>2/31/2021</div>", width: 65, dataIndex: 'hours', editor: { xtype: 'numberfield', minValue: 0}, summaryType: summaryType, summaryRenderer: summaryRenderer},
{text: "<div align=center>Mon<br>3/29/2021</div>", width: 75, align: "right", dataIndex: 'hours', editor: { xtype: 'numberfield', minValue: 0}, summaryType: sumType, summaryRenderer: sumRenderer},
{text: "<div align=center>Tue<br>3/30/2021</div>", width: 75, align: "right", dataIndex: 'hours', editor: { xtype: 'numberfield', minValue: 0}, summaryType: sumType, summaryRenderer: sumRenderer},
{text: "<div align=center>Wed<br>2/31/2021</div>", width: 75, align: "right", dataIndex: 'hours', editor: { xtype: 'numberfield', minValue: 0}, summaryType: sumType, summaryRenderer: sumRenderer},
{text: "<div align=center>Thu<br>2/31/2021</div>", width: 75, align: "right", dataIndex: 'hours', editor: { xtype: 'numberfield', minValue: 0}, summaryType: sumType, summaryRenderer: sumRenderer},
{text: "<div align=center>Fri<br>2/31/2021</div>", width: 75, align: "right", dataIndex: 'hours', editor: { xtype: 'numberfield', minValue: 0}, summaryType: sumType, summaryRenderer: sumRenderer},
{text: "<div align=center>Sat<br>2/31/2021</div>", width: 75, align: "right", dataIndex: 'hours', editor: { xtype: 'numberfield', minValue: 0}, summaryType: sumType, summaryRenderer: sumRenderer},
{text: "<div align=center>Sun<br>2/31/2021</div>", width: 75, align: "right", dataIndex: 'hours', editor: { xtype: 'numberfield', minValue: 0}, summaryType: sumType, summaryRenderer: sumRenderer},
{ text: "Sum", width: 75, dataIndex: 'note', align: "center",
renderer: function(value, metaData, record, rowIndex, colIndex, store, view) {
var hoursString = record.get('hours');
var hoursFloat = parseFloat(hoursString)
if ("number" == typeof(hoursFloat)) return Math.round(700.0 * hoursFloat) / 100.0;
return "";
},
summaryType: sumType, summaryRenderer: sumRenderer
}
// { text: "Note", flex: 1, dataIndex: 'note', editor: { allowBlank: true }}
]
});
...
...
@@ -576,7 +585,7 @@ Ext.onReady(function() {
});
// Load stores that need parameters
hourStore.getProxy().extraParams = {
user_id: @current_user_id@
, format: 'json' };
hourStore.getProxy().extraParams = {
query: "user_id = @current_user_id@ and day > '2021-03-10'"
, format: 'json' };
hourStore.load({
callback: function() {
console.log('PO.store.timesheet.HourStore: loaded');
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment