File tree Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ var SupplyDatasetUrl = React.createClass({
111
111
/>
112
112
113
113
{ /* array components require unique 'key' value */ }
114
- { inputs && inputs . map ( function ( value , index ) {
114
+ { inputs && inputs . map ( function ( value , index ) {
115
115
return < input
116
116
type = 'url'
117
117
name = 'svm_dataset[]'
Original file line number Diff line number Diff line change @@ -25,8 +25,8 @@ var SupplyPredictors = React.createClass({
25
25
var predictors = document . getElementsByClassName ( 'predictionInput' ) ;
26
26
27
27
{ /*
28
- Iterate the node list containing the supplied dataset (s). If the
29
- input value is a valid file , store 'true', within the array.
28
+ Iterate the node list containing the supplied predictors (s). If
29
+ input value is a valid float , store 'true', within the array.
30
30
*/ }
31
31
var boolArray = Array . prototype . map . call (
32
32
predictors ,
@@ -62,7 +62,7 @@ var SupplyPredictors = React.createClass({
62
62
63
63
{ /* array components require unique 'key' value */ }
64
64
{ options && options . map ( function ( value , index ) {
65
- var suffix = index . toString ( )
65
+ var suffix = index . toString ( ) ;
66
66
var predictor = this . state [ 'value_predictor_' + suffix ] ;
67
67
68
68
return < input
@@ -72,7 +72,7 @@ var SupplyPredictors = React.createClass({
72
72
placeholder = { value }
73
73
key = { index }
74
74
onChange = { this . validIntegerEntered }
75
- value = { predictor }
75
+ // value={predictor}
76
76
/> ;
77
77
} . bind ( this ) ) }
78
78
Original file line number Diff line number Diff line change @@ -26,12 +26,22 @@ var ModelPredict = React.createClass({
26
26
changeModelId : function ( event ) {
27
27
var modelId = event . target . value ;
28
28
29
+ // clear predictors, remove submit button
30
+ var predictors = document . getElementsByClassName ( 'predictionInput' ) ;
31
+
32
+ if ( predictors ) {
33
+ for ( var i = 0 ; i < predictors . length ; i ++ ) {
34
+ predictors [ i ] . value = '' ;
35
+ }
36
+ }
37
+ this . props . onChange ( { render_submit : false } ) ;
38
+
39
+ // store modelId into state
29
40
if ( modelId && modelId != '--Select--' && checkValidInt ( modelId ) ) {
30
41
this . setState ( { value_model_id : event . target . value } ) ;
31
42
}
32
43
else {
33
44
this . setState ( { value_model_id : '--Select--' } ) ;
34
- this . props . onChange ( { render_submit : false } ) ;
35
45
}
36
46
} ,
37
47
// update 'state properties' from child component (i.e. 'validStringEntered')
You can’t perform that action at this time.
0 commit comments