1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155
| var config = {
layout: {
name: 'layout',
padding: 0,
panels: [
{ type: 'left', size: 200, resizable: true, minSize: 120 },
{ type: 'main', minSize: 550, overflow: 'hidden' }
]
},
grid1: {
name: 'grid1',
columns: [
{ field: 'art', caption: 'Article', size: '15%', sortable: true, searchable: true },
{ field: 'mou', caption: 'Mouvement', size: '15%' },
{ field: 'sto', caption: 'Stock', size: '15%', sortable: true, searchable: true },
{ field: 'pro', caption: 'Projet', size: '15%', sortable: true, searchable: true },
{ field: 'doc', caption: 'Document', size: '15%', sortable: true, searchable: true },
{ field: 'dat', caption: 'Date', size: '100px', render: 'date:dd/mm/yyyy', sortable: true, searchable: true }
],
records: [
{ recid: 1, art: 'B0014', mou: '-5', sto: 'CONTENEUR 1', pro: '326', doc: 'BDS 0012', dat: '04/03/2012' },
{ recid: 2, art: 'B0014', mou: '6', sto: 'CONTENEUR 1', pro: '326', doc: 'CF BBI BGI 2018 0452-5', dat: '03/15/2012' }
],
},
form1: {
name : 'form1',
header : 'Auto-Generated Form',
url : 'server/post',
fields : [
{ field: 'first_name', type: 'text', required: true, html: { caption: 'First Name', attr: 'style="width: 300px"' } },
{ field: 'last_name', type: 'text', required: true, html: { caption: 'Last Name', attr: 'style="width: 300px"' } },
{ field: 'comments', type: 'textarea', html: { caption: 'Comments', attr: 'style="width: 300px; height: 90px"' } }
],
actions: {
'Save': function (event) {
console.log('save', event);
this.save();
},
'Clear': function (event) {
console.log('clear', event);
this.clear();
}
}
},
form2: {
name: 'form2',
formHTML:
'<div class="w2ui-page page-0">'+
' <div class="w2ui-field">'+
' <label>First Name:</label>'+
' <div>'+
' <input name="first_name" type="text" maxlength="100" size="60"/>'+
' </div>'+
' </div>'+
' <div class="w2ui-field">'+
' <label>Last Name:</label>'+
' <div>'+
' <input name="last_name" type="text" maxlength="100" size="60"/>'+
' </div>'+
' </div>'+
' <div class="w2ui-field">'+
' <label>Comments:</label>'+
' <div>'+
' <textarea name="comments" type="text" style="width: 100%; height: 80px; resize: none"></textarea>'+
' </div>'+
' </div>'+
'</div>'+
'<div class="w2ui-page page-1">'+
' <div class="w2ui-field">'+
' <label>Address:</label>'+
' <div>'+
' <input name="address1" type="text" maxlength="100" style="width: 100%"/>'+
' </div>'+
' </div>'+
' <div class="w2ui-field">'+
' <label>Line 2:</label>'+
' <div>'+
' <input name="address2" type="text" maxlength="100" style="width: 100%"/>'+
' </div>'+
' </div>'+
' <div class="w2ui-field">'+
' <label>City:</label>'+
' <div>'+
' <input name="city" type="text" maxlength="50" size="25"/>'+
' </div>'+
' </div>'+
' <div class="w2ui-field">'+
' <label>State:</label>'+
' <div>'+
' <input name="state" type="text" maxlength="2" size="2"/>'+
' </div>'+
' </div>'+
' <div class="w2ui-field">'+
' <label>Zip:</label>'+
' <div>'+
' <input name="zip" type="text" maxlength="10" size="10"/>'+
' </div>'+
' </div>'+
'</div>'+
'<div class="w2ui-page page-2">'+
' <div class="w2ui-field">'+
' <label>Short Bio:</label>'+
' <div>'+
' <textarea name="short_bio" type="text" style="width: 100%; height: 80px; resize: none"></textarea>'+
' </div>'+
' </div>'+
' <div class="w2ui-field">'+
' <label>Talk Name:</label>'+
' <div>'+
' <input name="talk_name" type="text" maxlength="100" style="width: 100%"/>'+
' </div>'+
' </div>'+
' <div class="w2ui-field">'+
' <label>Talk Description:</label>'+
' <div>'+
' <textarea name="description" type="text" style="width: 100%; height: 80px; resize: none"></textarea>'+
' </div>'+
' </div>'+
'</div>'+
'<div class="w2ui-buttons">'+
' <button class="w2ui-btn" name="reset">Reset</button>'+
' <button class="w2ui-btn" name="save">Save</button>'+
'</div>',
tabs: [
{ id: 'tab1', caption: 'General' },
{ id: 'tab2', caption: 'Address'},
{ id: 'tab3', caption: 'About' }
],
fields : [
{ field: 'first_name', type: 'text', required: true },
{ field: 'last_name', type: 'text', required: true },
{ field: 'comments', type: 'text'},
{ field: 'address1', type: 'text', required: true },
{ field: 'address2', type: 'text' },
{ field: 'city', type: 'text', required: true },
{ field: 'state', type: 'text', required: true },
{ field: 'zip', type: 'int', required: true },
{ field: 'short_bio', type: 'text' },
{ field: 'talk_name', type: 'text', required: true },
{ field: 'description', type: 'text' }
],
actions: {
reset: function () {
this.clear();
},
save: function () {
this.save();
}
}
}
}; |
Partager