Subversion Repositories SmartDukaan

Rev

Rev 25114 | Blame | Compare with Previous | Last modification | View Log | RSS feed

$(function() {
    $('select.item').live('change', function() {
        var tr = $(this).parent().parent();
        var option = $(this).find('option:selected');

        $(tr).find('.serialNumber').removeClass('required').addClass(option.attr('hasSerialNumber'));
        $(tr).find('.itemNumber').removeClass('required').addClass(option.attr('hasItemNumber'));

        if (option.attr('hasSerialNumber') == 'required' || option.val() == -1) {
            $(tr).find('.quantity').attr('readonly', true);
            $(tr).find('.quantity').val(1.0);
        }
        else {
            $(tr).find('.quantity').removeAttr('readonly');
        }

        return true;
    });
    
    $('#instructionsLink').live('click', function() {
        $('div#instrctionsDiv').show();
        $.colorbox({
            inline : true,
            width : "500px",
            height : "360px",
            href : "div#instrctionsDiv",
            onClosed : function() {
                $("div#instrctionsDiv").hide();
            }
                });
    });
    
    $("select#selectItemType").change(function () {
        var selectType = $(this).val();
        if(selectType=='SERIALIZED'){
                $("div#selectItem").show();
        }else{
                $("select#bulkScanUploadItem").val("-1");
                $("div#selectItem").hide();
        }
    });
});