PriceRule: Erste Version
[kivitendo-erp.git] / js / kivi.PriceRule.js
1 namespace('kivi.PriceRule', function(ns) {
2
3   ns.add_new_row = function (type) {
4     var data = {
5       action: 'PriceRule/add_item_row',
6       type: type
7     };
8     $.post('controller.pl', data, kivi.eval_json_result);
9   }
10
11   $(function() {
12     $('#price_rule_item_add').click(function() {
13       ns.add_new_row($('#price_rules_empty_item_select').val());
14     });
15     $('#price_rule_items').on('click', 'a.price_rule_remove_line', function(){
16       $(this).closest('div').remove();
17     })
18   });
19 });