From: Eric Fayolle Date: Tue, 15 Feb 2022 12:47:09 +0000 (+0100) Subject: Possibilite de supprimer les SIMP optionnels X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=dfbd2f22c4156c73de50eceba1cbd9992748c99f;p=tools%2Feficas.git Possibilite de supprimer les SIMP optionnels --- diff --git a/testFlask/templates/commandes_2.html b/testFlask/templates/commandes_2.html index 53158c54..f740127a 100644 --- a/testFlask/templates/commandes_2.html +++ b/testFlask/templates/commandes_2.html @@ -271,8 +271,8 @@ function clickOnCommand(treeCssSelStr, msgCssSelStr, cmdName, key ) { //$(tree.activeNode).scrollTop(20) //tree.activeNode.tr.offsetTop - $(document).scrollTop(tree.activeNode.tr.offsetTop); //Replace the active node in order to see the added command -}; + $(document).scrollTop(tree.activeNode.tr.offsetTop ); //Repostionning of the active node in order to see the added command +}; //BUG: Si le sendAppendChild n'est pas fini, @@ -574,51 +574,44 @@ $(function(){ ) .addClass(_attr) .find("input").css('color','black'); //TODO : A placer ds le CSS - actionListIndex=4; - // $tdList.eq(actionListIndex) - // .html(""); - if (statut == 'f') { - $tdList.eq(actionListIndex+1) - .html(""); - }; - $tdList.eq(actionListIndex+2) - .html(""); - - } else { // Not classeAccas == "MCSIMP" + + }; // Not classeAccas == "MCSIMP" - // THREE ICONS MANAGEMENT : +,Trash,? + // THREE ICONS MANAGEMENT : +,Trash,? + + plusFunction = undefined; + //trashFunction = "alert(\"glyphicon-trash : "+key+"\")"; + trashFunction = "clickOnRemove( \"#tree1\", \"#tree1-messages\", \""+key+"\" )"; + + if ( classeAccas == "MCSIMP" ) { + actionListIndex = 4; //TODO : Le paramétrer + } else { //$tdList.eq(2).prop("colspan", 2).nextAll().remove(); //Merge unused columns for easy keyboard navigation - plusFunction = undefined; - trashFunction = undefined; - if ( classeAccas == "PROCEDURE" || classeAccas == "OPER" ) { - plusFunction = "clickOnCommand( \"#tree1\", \"#tree1-messages\", \""+name+"\", \""+key+"\" )"; - trashFunction = "clickOnRemove( \"#tree1\", \"#tree1-messages\", \""+key+"\" )"; - } else if ( classeAccas == "MCFACT" ) { - if (repeatable) { - plusFunction = "sendAppendChild( \""+parentKey+"\", \""+cmdName+"\",null)"; - }; - trashFunction = "clickOnRemove( \"#tree1\", \"#tree1-messages\", \""+key+"\" )"; - } else { - // plusFunction = "alert(\"glyphicon-plus-sign : "+key+"\")"; - trashFunction = "alert(\"glyphicon-trash : "+key+"\")"; - }; - $tdList.eq(2).prop("colspan", 2); //Merge unused columns for easy keyboard navigation - actionListIndex=3; //TODO : Le paramétrer - if ( plusFunction != undefined ) { - $tdList.eq(actionListIndex) - .html(""); + actionListIndex=3; //TODO : Le paramétrer + } + + if ( classeAccas == "PROCEDURE" || classeAccas == "OPER" ) { + plusFunction = "clickOnCommand( \"#tree1\", \"#tree1-messages\", \""+name+"\", \""+key+"\" )"; + } else if ( classeAccas == "MCFACT" ) { + if (repeatable) { + plusFunction = "sendAppendChild( \""+parentKey+"\", \""+cmdName+"\",null)"; }; - if ( trashFunction != undefined ) { - if (statut == 'f') { - $tdList.eq(actionListIndex+1) - .html(""); - }; + }; + + if ( plusFunction != undefined ) { + $tdList.eq(actionListIndex) + .html(""); + }; + if ( trashFunction != undefined ) { + if (statut == 'f') { + $tdList.eq(actionListIndex+1) + .html(""); }; - $tdList.eq(actionListIndex+2) - .html(""); - }; + $tdList.eq(actionListIndex+2) + .html(""); + // OPTIONALS MANAGEMENT : @@ -883,29 +876,29 @@ $(function(){ // # Différents tests : -var tree1=$.ui.fancytree.getTree("#tree1") -a={ source: [ {title: "Node 1", key: "1000"},{title: "Folder 2", key: "2", folder: true, children: [ {title: "Node 2.1", key: "3000"},{title: "Node 2.2", key: "44"} ]} ], } -$("#Optionals").fancytree( a ) -ou -$.ui.fancytree.createTree('#Optionals', a) - -var tree2=$.ui.fancytree.getTree("#Optionals") -b=tree2.toDict() -$("#bebe").fancytree( { source: b} ) -$("#bebe").fancytree( { source: tree1.toDict()} ) -classeAccas == "MCSIMP" -p1=tree1.getNodeByKey("54930c427ad911ec90fb64c901d49bcd") -let myOpt=[} -p1.visit( (n)=>{if (n.data.classeAccas == "MCSIMP") {myOpt.push(n)}}, true) ------- - -var tree1=$.ui.fancytree.getTree("#tree1") -p1=tree1.getNodeByKey("721bcb347adc11ec8c2a64c901d49bcd") -opt=p1.data.infoOptionnels[0] - -var optNodes= opt.map((o)=>{return {'title':o} }) -optTreeSrc=[{'title': p1.title+' (optionals)', 'children': optNodes}]; -$optTree=$("#bebe").fancytree( { source: optTreeSrc} ) -optTree=$optTree.fancytree() -#var optTree=$.ui.fancytree.getTree("#bebe") -optTree.expandAll() +// var tree1=$.ui.fancytree.getTree("#tree1") +// a={ source: [ {title: "Node 1", key: "1000"},{title: "Folder 2", key: "2", folder: true, children: [ {title: "Node 2.1", key: "3000"},{title: "Node 2.2", key: "44"} ]} ], } +// $("#Optionals").fancytree( a ) +// ou +// $.ui.fancytree.createTree('#Optionals', a) + +// var tree2=$.ui.fancytree.getTree("#Optionals") +// b=tree2.toDict() +// $("#bebe").fancytree( { source: b} ) +// $("#bebe").fancytree( { source: tree1.toDict()} ) +// classeAccas == "MCSIMP" +// p1=tree1.getNodeByKey("54930c427ad911ec90fb64c901d49bcd") +// let myOpt=[} +// p1.visit( (n)=>{if (n.data.classeAccas == "MCSIMP") {myOpt.push(n)}}, true) +// ------ + +// var tree1=$.ui.fancytree.getTree("#tree1") +// p1=tree1.getNodeByKey("721bcb347adc11ec8c2a64c901d49bcd") +// opt=p1.data.infoOptionnels[0] + +// var optNodes= opt.map((o)=>{return {'title':o} }) +// optTreeSrc=[{'title': p1.title+' (optionals)', 'children': optNodes}]; +// $optTree=$("#bebe").fancytree( { source: optTreeSrc} ) +// optTree=$optTree.fancytree() +// #var optTree=$.ui.fancytree.getTree("#bebe") +// optTree.expandAll()