Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
dream
Commits
9a40db8b
Commit
9a40db8b
authored
Feb 26, 2014
by
Sebastien Robin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PartJobShop: sort spreadsheet results by order and entrance date
parent
40fbe338
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
1 deletion
+24
-1
dream/platform/static/src/dream.js
dream/platform/static/src/dream.js
+24
-1
No files found.
dream/platform/static/src/dream.js
View file @
9a40db8b
...
...
@@ -542,7 +542,30 @@
if
(
spreadsheet_data
.
length
>
1
)
{
var
job_schedule_spreadsheet
=
$
(
'
#job_schedule_spreadsheet
'
);
// Sort the spreadsheet data to an order convenient for end users
spreadsheet_data
.
sort
()
spreadsheet_data
.
sort
(
function
(
a
,
b
)
{
var
result
=
0
,
order_id_a
,
order_id_b
,
entrance_a
,
entrance_b
;
order_id_a
=
a
[
0
].
split
(
'
-
'
)[
0
];
order_id_b
=
b
[
0
].
split
(
'
-
'
)[
0
];
if
(
order_id_a
!==
order_id_b
)
{
if
(
order_id_a
>
order_id_b
)
{
result
=
1
;
}
else
{
result
=
-
1
;
}
}
else
{
entrance_a
=
a
[
6
];
entrance_b
=
b
[
6
];
if
(
entrance_a
>
entrance_b
)
{
result
=
1
;
}
else
if
(
entrance_a
<
entrance_b
)
{
result
=
-
1
;
}
else
{
result
=
0
;
}
}
return
result
;
});
if
(
configuration
[
'
Dream-Configuration
'
].
gui
.
job_schedule_spreadsheet
){
job_schedule_spreadsheet
.
show
();
job_schedule_spreadsheet
.
handsontable
({
...
...
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