Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
genotoul-bioinfo
jflow
Commits
19ed21eb
Commit
19ed21eb
authored
Jan 17, 2017
by
Floreal Cabanettes
Browse files
Add required events on handsontable
parent
d7bc12b4
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/js/jflow-wfform-rules.js
View file @
19ed21eb
...
...
@@ -342,12 +342,23 @@
var
__check_required
=
function
()
{
var
condition_raised
=
_check_condition_raised
(
conditions_params
,
which
);
var
param_name
=
param_input
.
selector
.
substr
(
1
);
if
(
condition_raised
)
{
param_input
.
rules
(
"
add
"
,
{
"
required
"
:
true
});
if
(
param_name
.
indexOf
(
"
___
"
)
==
-
1
)
{
param_input
.
rules
(
"
add
"
,
{
"
required
"
:
true
});
}
else
{
handsontables
[
param_name
.
split
(
"
___
"
)[
0
]].
allRequired
[
param_name
]
=
true
;
}
}
else
{
param_input
.
rules
(
"
remove
"
,
"
required
"
);
param_input
.
valid
();
if
(
param_name
.
indexOf
(
"
___
"
)
==
-
1
)
{
param_input
.
rules
(
"
remove
"
,
"
required
"
);
param_input
.
valid
();
}
else
{
handsontables
[
param_name
.
split
(
"
___
"
)[
0
]].
allRequired
[
param_name
]
=
false
;
}
}
}
...
...
src/js/jflow-wfform.js
View file @
19ed21eb
...
...
@@ -221,6 +221,8 @@ jQuery.validator.addMethod("mparam", function(value, element, params) {
return
true
;
});
var
handsontables
=
{};
// handle bootstrap datepicker with handsontable
(
function
(
Handsontable
)
{
var
BootstrapDateEditor
=
Handsontable
.
editors
.
TextEditor
.
prototype
.
extend
();
...
...
@@ -786,8 +788,6 @@ Handsontable.cellTypes["bootdate"] = Handsontable.BootstrapDateCell;
$
(
"
#workflow_form
"
).
validate
({
rules
:
rules
});
var
params
=
JflowWfformRules
.
check_parameters_rules
(
$this
.
workflow
.
parameters
,
$this
);
// handle inputfile
$
(
"
a[class^=inputfile_]
"
).
click
(
function
(){
$
(
"
#
"
+
$
(
this
).
attr
(
"
class
"
)).
html
(
$
(
this
).
html
());
...
...
@@ -943,6 +943,9 @@ Handsontable.cellTypes["bootdate"] = Handsontable.BootstrapDateCell;
allActions
=
{},
allRequired
=
{},
allHelps
=
{};
handsontables
[
param_name
]
=
$
.
extend
(
$
(
this
),
{
allRequired
:
allRequired
});
allHelps
[
param_name
]
=
params_per_name
[
param_name
].
help
;
for
(
var
i
in
params_per_name
[
param_name
].
sub_parameters
)
{
dataSchema
[
params_per_name
[
param_name
].
sub_parameters
[
i
].
name
]
=
null
;
...
...
@@ -1184,6 +1187,8 @@ Handsontable.cellTypes["bootdate"] = Handsontable.BootstrapDateCell;
if
(
$this
.
options
.
displayResetButton
)
{
$
(
"
#wfform_reset_btn
"
).
click
(
function
()
{
$this
.
reset
();
})
}
var
params
=
JflowWfformRules
.
check_parameters_rules
(
$this
.
workflow
.
parameters
,
$this
);
}
});
}
...
...
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