Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision efef8dbd

Von Sven Schöling vor mehr als 12 Jahren hinzugefügt

  • ID efef8dbd0df5877d736cf25dcb56a15e0f3037be
  • Vorgänger 438c47c0
  • Nachfolger 9a4e5185

template für reports als ajaxblock

Unterschiede anzeigen:

templates/webpages/ic/sales_price_information.html
1
<div id='sales_price_information_sales_order'></div>
2
<div id='sales_price_information_sales_quotation'></div>
3

  
4
<script type='text/javascript'>
5
  function get_report(target, source, data){
6
    $.ajax({
7
      url:        source,
8
//      beforeSend: function () { $(target).html('<img src="image/spinner.gif">') },
9
      success:    function (rsp) {
10
        $(target).html(rsp);
11
        $(target).find('.paginate').find('a').click(function(event){ redirect_event(event, target) });
12
        $(target).find('a.report-generator-header-link').click(function(event){ redirect_event(event, target) });
13
      },
14
      data:       data,
15
    });
16
  };
17

  
18
  function redirect_event(event, target){
19
    event.preventDefault();
20
    get_report(target, event.target + '', {});
21
  }
22

  
23
  $(document).ready(function(){
24
    get_report('#sales_price_information_sales_order', 'controller.pl', { action: 'SellPriceInformation/list', 'filter.part.id': [% id %], 'filter.order.type': 'sales_order' });
25
    get_report('#sales_price_information_sales_quotation', 'controller.pl', { action: 'SellPriceInformation/list', 'filter.part.id': [% id %], 'filter.order.type': 'sales_quotation' });
26
  });
27

  
28

  
29
</script>

Auch abrufbar als: Unified diff