1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- abk = [];
- fullpattern = [];
- function createPatternForm(){
- /* Load pattern config */
- //Create form for WAS/Stations/Pattern and WAS/Slicer
- var populate = ["FormPattern","FormPattern2", "FormPattern3", "FormPatternAssignment"]
-
- var first = true;
- populate.forEach(function(populate2){
- $.getJSON( "../server/json/ProductCode.json", function( data ) {
- fullpattern = data;
- $.each( data["pattern"], function(i, item){
- var clone = document.importNode(document.querySelector('#PatternFormInit').content,true);
- $('[data-class=Name]',clone).text(item["name"]);
- $('[data-class=Abkürzung]',clone).text(item["abk"]);
- if(first)
- abk.push(item["abk"])
- $('[data-class=Optionen]',clone).attr("name",item["abk"])
- $.each( item["types"], function(i, item){
- $('[data-class=Optionen]',clone).append('<option value="' + item +'">' + item +'</option>');
- });
- $('[data-class=Optionen]',clone).attr("id", populate2 + "_Form_" + item["abk"]);
-
- $('#' + populate2).append(clone);
- });
- //Add "Text" to abk to show it within rects
- first = false;
-
- //on Patternform2 change trigger assignment default reset
- if(populate2 == "FormPattern2"){
- abk.forEach(function(localabk){
- $("#FormPattern2_Form_" + localabk).change(refreshassignments);
- });
- }
- });
- });
- abk.length = 0;
-
- //get Save locations
- $.getJSON( "../server/json/SlicerConfig.json", function( data ) {
- $.each( data["saveLocation"], function(i, item){
- $("#savelocation").append('<option value="' + item +'">' + item +'</option>');
- });
- });
- }
|