Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 59486b32

Von Moritz Bunkus vor mehr als 13 Jahren hinzugefügt

  • ID 59486b328d1d3b7ee01cfab020b5732581cbfb1c
  • Vorgänger a65c8e99
  • Nachfolger 10af2ad6

Lieferungentab mit jQuery & AJAX neu laden lassen, nicht via CGI::AJAX

Unterschiede anzeigen:

bin/mozilla/ct.pl
45 45
# $locale->text('Vendor deleted!')
46 46
# $locale->text('Cannot delete vendor!')
47 47

  
48
use CGI::Ajax;
49 48
use POSIX qw(strftime);
50 49

  
51 50
use SL::CT;
......
327 326
  $form->{taxzone_id}     = 0                                                               if !$form->{id};
328 327
  $form->{jsscript}       = 1;
329 328
  $form->{fokus}          = "ct.greeting";
330
  $form->{AJAX}           = [ new CGI::Ajax( map {; "get_$_" => "$form->{script}?action=get_$_" } qw(delivery) ) ];
331 329
  $form->{SHIPTO_ALL}     = [ +{ shipto_id => '0', shiptoname => $::locale->text('All') }, @{ $form->{SHIPTO} } ];
332 330

  
333 331
  $form->{title} = $form->{title_save}
templates/webpages/ct/form_header.html
317 317
    <table>
318 318
     <tr>
319 319
      <th align="right">[% 'Shipping Address' | $T8 %]</th>
320
      <td>
321
       [%- INCLUDE generic/multibox.html
322
             name       = 'delivery_id',
323
             id         = 'delivery_id',
324
             DATA       = SHIPTO_ALL,
325
             onChange   = "get_delivery(['shipto_id__' + this.value, 'from__' + from.value, 'to__' + to.value, 'id__' + cvid.value, 'db__' + db.value], ['delivery'])",
326
             id_key     = 'shipto_id',
327
             label_sub  = 'shipto_label',
328
             show_empty = 1,
329
       -%]
320
      <td colspan="3">
321
       [% L.select_tag('delivery_id', L.options_for_select(SHIPTO_ALL, title_sub => \shipto_label, with_empty => 1),
322
                       onchange => "\$('#delivery').load('ct.pl?action=get_delivery&id=' + \$('#cvid').attr('value') + '&db=' + \$('#db').attr('value') + '&shipto_id=' + this.value)") %]
330 323
      </td>
331 324
     </tr>
332 325

  
templates/webpages/ct/get_delivery.html
1 1
[%- USE T8 %]
2 2
[% USE HTML %][% USE LxERP %]
3
<div id="delivery">
3 4
<table width="100%">
4 5
  <tr>
5 6
    <td>
......
39 40
[%- IF DELIVERY.size == 15 %]
40 41
     <p>[% 'This list is capped at 15 items to keep it fast. If you need a full list, please use reports.' | $T8 %]</p>
41 42
[%- END %]
43
</div>

Auch abrufbar als: Unified diff