Subversion Repositories SmartDukaan

Rev

Rev 5369 | Rev 7410 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5369 Rev 5496
Line 1... Line 1...
1
$(function() {
1
$(function() {
2
    $('select.item').live('change', function() {
2
    $('select.item').live('change', function() {
3
        var tr = $(this).parent().parent();
3
        var tr = $(this).parent().parent();
4
        var serialized = $(this).find('option:selected').attr('serialized');
4
        var option = $(this).find('option:selected');
5
        $(tr).find('.productGroup').val(serialized);
-
 
6
 
5
 
7
        if (serialized == 'SERIALIZED') {
6
        $(tr).find('.serialNumber').removeClass('required').addClass(option.attr('hasSerialNumber'));
8
            $(tr).find('.itemNumber').attr('readonly', false);
7
        $(tr).find('.itemNumber').removeClass('required').addClass(option.attr('hasItemNumber'));
-
 
8
 
9
            $(tr).find('.serialNumber').attr('readonly', false);
9
        if (option.attr('hasSerialNumber') == 'required' || option.val() == -1) {
10
            $(tr).find('.quantity').attr('readonly', true);
10
            $(tr).find('.quantity').attr('readonly', true);
11
            $(tr).find('.quantity').val(1);
11
            $(tr).find('.quantity').val(1.0);
12
        }
12
        }
13
        else {
13
        else {
14
            $(tr).find('.itemNumber').attr('readonly', true);
-
 
15
            $(tr).find('.serialNumber').attr('readonly', true);
-
 
16
            $(tr).find('.quantity').attr('readonly', false);
14
            $(tr).find('.quantity').removeAttr('readonly');
17
        }
15
        }
18
 
16
 
19
        return true;
17
        return true;
20
    });
18
    });
21
});
19
});