Subversion Repositories SmartDukaan

Rev

Rev 5527 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4207 mandeep.dh 1
$(function() {
2
    $('input#add-item').live('click', function() {
3
        addNewRowForItem();
4
    });
5
 
6
    $('a#remove-item').live('click', function() {
7
        $(this).closest('tr').remove();
8
        updateTotalAmount();
9
    });
10
 
11
    $('#bulk-order').live('submit', function() {
12
        submitBulkOrderForm();
13
        return false;
14
    });
15
 
16
    $('input[name$=unit_price]').live('change', function() {
17
        var quantity = $(this).closest('tr').find('input[name$=quantity]');
18
        var price    = $(this).val();
19
        $(this).closest('tr').find('#item-amount').html(quantity * price);
20
        updateTotalAmount();
21
    });
22
 
23
    $('input[name$=quantity]').live('change', function() {
24
        var price = $(this).closest('tr').find('input[name$=unit_price]');
25
        var quantity    = $(this).val();
26
        $(this).closest('tr').find('#item-amount').html(quantity * price);
27
        updateTotalAmount();
28
    });
29
 
30
    $('input[name$=item_id]').live('change', function() {
31
        updateModelName($(this).closest('tr'), $(this).val());
32
    });
33
});