Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
f0695914
Commit
f0695914
authored
10 years ago
by
juanf
Browse files
Options
Downloads
Patches
Plain Diff
SSDM-344 : New Free Form Table structure (ongoing work).
SVN: 32246
parent
3f6c40bf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/SampleForm/widgets/FreeFormTableView.js
+30
-13
30 additions, 13 deletions
...ser/html/js/views/SampleForm/widgets/FreeFormTableView.js
with
30 additions
and
13 deletions
plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/SampleForm/widgets/FreeFormTableView.js
+
30
−
13
View file @
f0695914
...
@@ -17,17 +17,30 @@
...
@@ -17,17 +17,30 @@
function
FreeFormTableView
(
freeFormTableController
,
freeFormTableModel
)
{
function
FreeFormTableView
(
freeFormTableController
,
freeFormTableModel
)
{
this
.
_dilutionTableController
=
freeFormTableController
;
this
.
_dilutionTableController
=
freeFormTableController
;
this
.
_freeFormTableModel
=
freeFormTableModel
;
this
.
_freeFormTableModel
=
freeFormTableModel
;
this
.
_tableViews
=
[];
this
.
_getSwitchForTable
=
function
(
tableIdx
)
{
this
.
_getSwitchForTable
=
function
(
tableIdx
)
{
var
_this
=
this
;
var
$switch
=
$
(
"
<div>
"
,
{
"
class
"
:
"
switch-toggle well
"
,
"
style
"
:
"
width:33%; margin-left: auto; margin-right: auto; min-height: 38px !important;
"
});
var
$switch
=
$
(
"
<div>
"
,
{
"
class
"
:
"
switch-toggle well
"
,
"
style
"
:
"
width:33%; margin-left: auto; margin-right: auto; min-height: 38px !important;
"
});
$switch
.
change
(
function
(
event
)
{
var
changeEvent
=
function
(
index
)
{
var
isMini
=
$
(
this
).
children
()[
0
].
checked
;
return
function
(
event
)
{
if
(
isMini
)
{
var
isMini
=
$
(
this
).
children
()[
0
].
checked
;
alert
(
'
Mini!
'
);
var
tableData
=
_this
.
_freeFormTableModel
.
tables
[
index
];
}
else
{
var
tableView
=
null
;
alert
(
'
Detailed!
'
);
var
tableViewWrapper
=
_this
.
_tableViews
[
index
];
tableViewWrapper
.
empty
();
if
(
isMini
)
{
tableView
=
_this
.
_getMiniTable
(
tableData
.
modelMini
);
}
else
{
tableView
=
_this
.
_getDetailedTable
(
tableData
.
modelDetailed
);
}
tableViewWrapper
.
append
(
tableView
);
}
}
});
}
$switch
.
change
(
changeEvent
(
tableIdx
));
$switch
$switch
.
append
(
$
(
"
<input>
"
,
{
"
value
"
:
"
mini
"
,
"
id
"
:
"
tableModeMini
"
,
"
name
"
:
"
tableMode
"
,
"
type
"
:
"
radio
"
,
"
checked
"
:
""
}))
.
append
(
$
(
"
<input>
"
,
{
"
value
"
:
"
mini
"
,
"
id
"
:
"
tableModeMini
"
,
"
name
"
:
"
tableMode
"
,
"
type
"
:
"
radio
"
,
"
checked
"
:
""
}))
...
@@ -46,7 +59,7 @@ function FreeFormTableView(freeFormTableController, freeFormTableModel) {
...
@@ -46,7 +59,7 @@ function FreeFormTableView(freeFormTableController, freeFormTableModel) {
if
(
this
.
_freeFormTableModel
.
isEnabled
)
{
if
(
this
.
_freeFormTableModel
.
isEnabled
)
{
var
$textField
=
FormUtil
.
_getInputField
(
'
text
'
,
null
,
"
Column
"
+
(
i
+
1
),
null
,
false
);
var
$textField
=
FormUtil
.
_getInputField
(
'
text
'
,
null
,
"
Column
"
+
(
i
+
1
),
null
,
false
);
$textField
.
val
(
modelMini
.
columns
[
i
]);
$textField
.
val
(
modelMini
.
columns
[
i
]);
$colsContainer
.
append
(
FormUtil
.
getFieldForComponentWithLabel
(
$textField
,
"
Co
de
"
));
$colsContainer
.
append
(
FormUtil
.
getFieldForComponentWithLabel
(
$textField
,
"
Co
lumn
"
+
(
i
+
1
)
));
}
else
{
}
else
{
$colsContainer
.
append
(
FormUtil
.
getFieldForLabelWithText
(
"
Column
"
+
(
i
+
1
),
modelMini
.
columns
[
i
]));
$colsContainer
.
append
(
FormUtil
.
getFieldForLabelWithText
(
"
Column
"
+
(
i
+
1
),
modelMini
.
columns
[
i
]));
}
}
...
@@ -56,8 +69,9 @@ function FreeFormTableView(freeFormTableController, freeFormTableModel) {
...
@@ -56,8 +69,9 @@ function FreeFormTableView(freeFormTableController, freeFormTableModel) {
for
(
var
i
=
0
;
i
<
modelMini
.
columns
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
modelMini
.
columns
.
length
;
i
++
)
{
if
(
this
.
_freeFormTableModel
.
isEnabled
)
{
if
(
this
.
_freeFormTableModel
.
isEnabled
)
{
var
$textField
=
FormUtil
.
_getInputField
(
'
text
'
,
null
,
"
Row
"
+
(
i
+
1
),
null
,
false
);
var
$textField
=
FormUtil
.
_getInputField
(
'
text
'
,
null
,
"
Row
"
+
(
i
+
1
),
null
,
false
);
$textField
.
keyup
(
function
()
{});
$textField
.
val
(
modelMini
.
rows
[
i
]);
$textField
.
val
(
modelMini
.
rows
[
i
]);
$rowsContainer
.
append
(
FormUtil
.
getFieldForComponentWithLabel
(
$textField
,
"
Code
"
));
$rowsContainer
.
append
(
FormUtil
.
getFieldForComponentWithLabel
(
$textField
,
"
Row
"
+
(
i
+
1
)
));
}
else
{
}
else
{
$rowsContainer
.
append
(
FormUtil
.
getFieldForLabelWithText
(
"
Row
"
+
(
i
+
1
),
modelMini
.
rows
[
i
]));
$rowsContainer
.
append
(
FormUtil
.
getFieldForLabelWithText
(
"
Row
"
+
(
i
+
1
),
modelMini
.
rows
[
i
]));
}
}
...
@@ -143,9 +157,12 @@ function FreeFormTableView(freeFormTableController, freeFormTableModel) {
...
@@ -143,9 +157,12 @@ function FreeFormTableView(freeFormTableController, freeFormTableModel) {
.
append
(
$title
)
.
append
(
$title
)
.
append
(
$toolBar
);
.
append
(
$toolBar
);
$tableContainer
.
append
(
$titleAndToolbar
);
var
$wrappedTable
=
$
(
"
<div>
"
).
append
(
this
.
_getMiniTable
(
tableData
.
modelMini
));
//$tableContainer.append(this._getMiniTable(tableData.modelMini));
this
.
_tableViews
.
push
(
$wrappedTable
);
$tableContainer
.
append
(
this
.
_getDetailedTable
(
tableData
.
modelDetailed
));
$tableContainer
.
append
(
$titleAndToolbar
)
.
append
(
$wrappedTable
);
$container
.
append
(
$tableContainer
);
$container
.
append
(
$tableContainer
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment