$(document).ready(function () {
//
// Enable selectBox control and bind events
//
$("#create").click(function () {
$(".customselect").selectBox();
});
$("#destroy").click(function () {
$(".customselect").selectBox('destroy');
});
$("#enable").click(function () {
$(".customselect").selectBox('enable');
});
$("#disable").click(function () {
$(".customselect").selectBox('disable');
});
$("#serialize").click(function () {
$("#console").append('
-- Serialized data --
' + $("FORM").serialize().replace(/&/g, '
') + '
');
$("#console")[0].scrollTop = $("#console")[0].scrollHeight;
});
$("#value-1").click(function () {
$(".customselect").selectBox('value', 1);
});
$("#value-2").click(function () {
$(".customselect").selectBox('value', 2);
});
$("#value-2-4").click(function () {
$(".customselect").selectBox('value', [2, 4]);
});
$("#options").click(function () {
$(".customselect").selectBox('options', {
'Opt Group 1': {
'1': 'Value 1',
'2': 'Value 2',
'3': 'Value 3',
'4': 'Value 4',
'5': 'Value 5'
},
'Opt Group 2': {
'6': 'Value 6',
'7': 'Value 7',
'8': 'Value 8',
'9': 'Value 9',
'10': 'Value 10'
},
'Opt Group 3': {
'11': 'Value 11',
'12': 'Value 12',
'13': 'Value 13',
'14': 'Value 14',
'15': 'Value 15'
}
});
});
$("#default").click(function () {
$(".customselect").selectBox('settings', {
'menuTransition': 'default',
'menuSpeed': 0
});
});
$("#fade").click(function () {
$(".customselect").selectBox('settings', {
'menuTransition': 'fade',
'menuSpeed': 'fast'
});
});
$("#slide").click(function () {
$(".customselect").selectBox('settings', {
'menuTransition': 'slide',
'menuSpeed': 'fast'
});
});
$(".customselect")
.selectBox()
.focus(function () {
$("#console").append('Focus on ' + $(this).attr('name') + '
');
//$("#console")[0].scrollTop = $("#console")[0].scrollHeight;
})
.blur(function () {
$("#console").append('Blur on ' + $(this).attr('name') + '
');
//$("#console")[0].scrollTop = $("#console")[0].scrollHeight;
})
.change(function () {
$("#console").append('Change on ' + $(this).attr('name') + ': ' + $(this).val() + '
');
//$("#console")[0].scrollTop = $("#console")[0].scrollHeight;
// *** Handle a change to the currency dropdown in the header ***
if ($(this).attr('name') == 'standard-dropdown') {
// *** Run procedure in JS Site Basket (DbJsBasket_ReceiverAPI.js) javascript loaded into page header ***
objMainSiteBasket.ChangeBasketCurrency(($(this).val() - 1), document.URL)
}
});
});