]> SALOME platform Git repositories - tools/eficas.git/commitdiff
Salome HOME
Essai champ valide/invalide
authorEric Fayolle <eric.fayolle@edf.fr>
Tue, 26 Oct 2021 15:03:25 +0000 (17:03 +0200)
committerEric Fayolle <eric.fayolle@edf.fr>
Tue, 26 Oct 2021 15:03:25 +0000 (17:03 +0200)
testFlask/templates/base.html
testFlask/templates/commandes_2.html

index 65df47a8e84b525225e6aa9997ead148ea15c6fe..3dfe9e13a82de886bf7c539e99cae0297cb35c69 100644 (file)
@@ -12,7 +12,7 @@
     <script src="//code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>
     <!-- jQuery library -->
     <!-- <script src="//code.jquery.com/jquery-3.6.0.js"></script> -->
-    <!-- <script src="//code.jquery.com/ui/1.12.1/jquery-ui.js"></script> -->
+    <!-- <script src="//code.jquery.com/ui/3.6.0/jquery-ui.js"></script> -->
 
     <!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> -->
     <!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> -->
index affad4b5fae7442439d9bbf64b60732a44a9fa99..4d5ab161274ad658282881cfc384dd876356cd8d 100644 (file)
@@ -205,9 +205,10 @@ return  {{ mcTraiteJson|tojson }};
        //if ( node.data.class ~ "EFC_SIMP" )
 //        if ( node.title === "param1" ) {
         if (node.data.classeAccas ==  "MCSIMP") {
-       $tdList.eq(3).html("<simp><input type='input' class='form-control-sm' id='simp1' placeholder='"+node.data.wValue+"' value='"+node.data.wValue+"'></simp>");
-       $tdList.eq(3).css('color','black') //td
-//KO:  $tdList.eq(3).find(">input").css('color','black')
+//     $tdList.eq(3).html("<simp><input type='input' class='form-control-sm' id='simp1' placeholder='"+node.data.wValue+"' value='"+node.data.wValue+"'></simp>");
+       $tdList.eq(3).html("<form class='was-validated'><div class='form-group'><input type='input' class='form-control-sm' id='simp1' placeholder='"+node.data.wValue+"' value='"+node.data.wValue+"' required><div class='valid-feedback'>Valid.</div><div class='invalid-feedback'>Please fill out this field.</div></div></form>");
+//$tdList.eq(3).css('color','black') //td
+       $tdList.eq(3).find("input").css('color','black')
 <!-- $tdList.eq(3).html("<simp>"+node.data.wValue+"</simp>"); -->
         }
       },
@@ -224,6 +225,7 @@ return  {{ mcTraiteJson|tojson }};
       },
       defaultGridAction: function( event, data ) {
           var node = data.node
+          input=$(node.tr).find('input')
           // Called when ENTER is pressed in cell-mode.
           // Return false to prevent default
           console.log("event.type, data :"+event.type+" , "+data);
@@ -238,7 +240,7 @@ return  {{ mcTraiteJson|tojson }};
           $.ajax({
                type: "POST",
                url: "{{ url_for('updateSimp') }}",
-               data: JSON.stringify({id: node.key, data:45 }),
+               data: JSON.stringify({id: node.key, data:input.val() }),
 //               data: JSON.stringify({id: 5}),
                contentType: "application/json; charset=utf-8",
                dataType: "json",