41652b8a0db99bce8cc2fa6c2f2abb2de024f9fd
[kivitendo-erp.git] / templates / webpages / customer_vendor / test_page.html
1 [% USE L %]
2
3 <h1>Customer Vendor Autocomplete Testpage</h1>
4
5 <br>
6 Customer: with preselected id 822<br>
7 [% L.customer_vendor_picker('customer_id', 822, type='customer') %]<br>
8
9 <br><hr>
10 Vendor: <br>
11 [% L.customer_vendor_picker('vendor_id', '', type='vendor') %]<br>
12
13 <br><hr>
14 customer with fat change<br>
15 [% L.customer_vendor_picker('customer_id2', '', type='customer', fat_set_item=1) %]<br>
16 <div>id from change <span id='change1'></span></div>
17 <div>greeting from fat change <span id='change2'></span></div>
18
19 <br><hr>
20 fat vendor with change<br>
21 [% L.customer_vendor_picker('vendor_id2', '', type='vendor', fat_set_item=1) %]<br>
22 <div>id  from change<span id='change3'></span></div>
23 <div>greeting from fat change <span id='change4'></span></div>
24
25 <br><hr>
26 this one will be reinit_widget after 4s:<br>
27 <span id='vendor3' class="">
28 <input id="vendor3_id" class="" type="hidden" name="vendor3_id" value="">
29 <input id="vendor3_id_type" type="hidden" name="" value="vendor">
30 <input id="vendor3_id_name" type="text" name="" value="">
31 </span>
32
33 <br><hr>
34 this shouold have three '-' before and after touching:<br>
35 ---[% L.customer_vendor_picker('vendor5_id', '', type='vendor') %]---
36
37
38 <script type='text/javascript'>
39  $('#customer_id2').change(function() { $('#change1').html($('#customer_id2').val()) })
40  $('#customer_id2').on('set_item:CustomerVendorPicker', function(e,o) { $('#change2').html(o.greeting) })
41
42  $('#vendor_id2').change(function() { $('#change3').html($('#vendor_id2').val()) })
43  $('#vendor_id2').on('set_item:CustomerVendorPicker', function(e,o) { $('#change4').html(o.greeting) })
44
45 window.setTimeout(function() {
46   console.log("adding last one now!");
47   $('#vendor3_id').addClass('customer_vendor_autocomplete');
48   $('#vendor3').addClass('customer_vendor_picker');
49   kivi.reinit_widgets();
50 }, 4000);
51 </script>
52