PageSourceSearch

https://www.reddearboles.org/nwlib6/nwproject/modules/examplesNwMaker/forms/f_example_form.js

js reddearboles.org collected 2026-09-28 13:30:28 UTC 6,249 bytes, 195 lines download raw bytes

1function f_example_form(pr) {
2    var self = createDocument(".f_example_form");
3//    var self = generateSelf();
4    if (pr != undefined) {
5        if (pr != "popup") {
6            self = pr;
7        }
8    }
9    var thisDoc = this;
10    this.constructor = constructor;
11    this.updateContend = updateContend;
12    this.self = self;
13    function constructor(r) {
14        var fields = [
15            {
16                tipo: 'textField',
17                nombre: 'ID',
18                name: 'id',
19                requerido: "NO",
20                visible: false
21            },
22            {
23                title: "Sube tu archivo",
24                mode: "horizontal",
25                name_group: "contenedor_1",
26                numberCols: "1",
27                tipo: "startGroup"
28            },
29            {
30                type: 'textField',
31                mode: 'int',
32                car_min: 2,
33                car_max: 3,
34                min_numer: 4,
35                max_number: 500,
36                nombre: 'type: textField, mode: int, car_min:2, car_max:3, min_numer:4, max_numer: 500',
37                name: 'num1',
38                placeholder: '12123',
39                requerido: "SI"
40            },
41            {
42                tipo: 'textField',
43                mode: 'money',
44                nombre: 'tipo: textField, mode: money',
45                name: 'num2',
46                requerido: "SI"
47            },
48            {
49                tipo: 'uploader',
50                nombre: 'Archivo',
51                name: 'ruta',
52                requerido: "SI"
53            },
54            {
55                tipo: "endGroup"
56            },
57            {
58                title: "Comparte",
59                mode: "horizontal",
60                name_group: "contenedor_2",
61                numberCols: "1",
62                tipo: "startGroup"
63            },
64            {
65                tipo: 'selectBox',
66                nombre: 'Compartir con',
67                name: 'compartir',
68                requerido: "SI"
69            },
70            {
71                tipo: "endGroup"
72            },
73            {
74                title: "navTable...",
75                mode: "vertical",
76                name_group: "contenedor_3",
77                numberCols: "1",
78                tipo: "startGroup"
79            },
80            {
81                tipo: 'textField',
82                nombre: 'Nombre',
83                name: 'nombre',
84                requerido: "NO"
85            },
86            {
87                tipo: 'button',
88                nombre: 'Agregar',
89                name: 'agregar_a'
90            },
91            {
92                tipo: "endGroup"
93            },
94            {
95                title: "navTable 2...",
96                mode: "vertical",
97                name_group: "contenedor_4",
98                numberCols: "1",
99                tipo: "startGroup"
100            },
101            {
102                tipo: "endGroup"
103            }
104        ];
105        var typ = "popUp";
106        if (typeof pr != "undefined") {
107            typ = "nopopUp";
108        }
109        createNwForms(self, fields, typ);
110
111        setColumnsFormNumber(self, 1);
112
113        $(self + " .uploader_ruta").attr("self-div", self + " #nwform");
114
115        setModal(true);
116        setWidth(self, 700);
117        var data = {};
118        data["publico"] = "Público";
119        data["solo_yo"] = "Solo yo";
120        populateSelectFromArray("compartir", data);
121
122        listAddCssFor(self, ".contain_input_name_nombre", {"width": "auto"});
123        listAddCssFor(self, ".contain_input_name_agregar_a", {"width": "auto"});
124
125        loadJs("/nwlib6/nwproject/modules/examplesNwMaker/lists/l_navtable_example.js");
126        loadJs("/nwlib6/nwproject/modules/examplesNwMaker/forms/f_navtable_example.js");
127        var navTable = addNavTable(self, "contenedor_3", l_navtable_example);
128        var btn = selfButton(self, "agregar_a");
129        btn.click(function () {
130//            var d = new f_navtable_example(navTable);
131//            d.constructor();
132            var data = getRecordNwForm(self);
133            addRowNavTable(navTable, data);
134            setValue(self, "nombre", "");
135        });
136
137        loadJs("/nwlib6/nwproject/modules/examplesNwMaker/lists/l_navtable_example_1.js");
138        loadJs("/nwlib6/nwproject/modules/examplesNwMaker/forms/f_navtable_example_1.js");
139        var navTableDos = addNavTable(self, "contenedor_4", l_navtable_example_1);
140
141
142        var accept = addButtonNwForm("Guardar", self);
143        var cancel = addButtonNwForm("Cancelar", self);
144        cancel.click(function () {
145            rejectForm(self);
146        });
147        accept.click(function () {
148            if (!validateRequired(self)) {
149                return;
150            }
151            loading("Cargando", "rgba(255, 255, 255, 0.76)!important", self);
152            var data = getRecordNwForm(self);
153            data["nombre"] = nombre($(self + " .uploader_filenw").val());
154            data["detalle"] = getDataNavTable(navTable);
155            data["detalle_dos"] = getDataNavTable(navTableDos);
156            console.log(data);
157            removeLoading(self);
158            return true;
159//            var rpc = {};
160//            rpc["service"] = "nw_drive";
161//            rpc["method"] = "subir_file";
162//            rpc["data"] = data;
163//            var func = function (r) {
164//                if (!verifyErrorNwMaker(r)) {
165//                    return;
166//                }
167//                if (r) {
168//                    var d = new l_files();
169//                    d.updateContend();
170//                    rejectForm(self, typeForm);
171//                } else {
172//                    nw_dialog("A ocurrido un error: " + r);
173//                }
174//                removeLoading(self);
175//            };
176//            rpcNw("rpcNw", rpc, func, true);
177        });
178
179        thisDoc.updateContend(r);
180
181        var html = "<h3>Código:</h3>";
182        html += "<iframe scrolling='auto' class='framecode' src='/nwlib6/nwproject/modules/examplesNwMaker/forms/f_example_form.js' ></iframe>";
183        addFooterNote(self, html);
184
185        removeLoadingNw();
186    }
187    function updateContend(ra) {
188        setRecord(self, ra);
189    }
190    function nombre(fic) {
191        fic = fic.split('\\');
192        return fic[fic.length - 1];
193    }
194
195}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.