This is the documentation for LemonStand V1, which has been discontinued. You can learn more and upgrade your store here.

LemonStand Version 1 Has Been Discontinued

This documentation is for LemonStand Version 1. LemonStand is now offered as a cloud-based eCommerce platform.
You can try the new LemonStand and learn about upgrading here.

Working with Checkboxes and Drop-Down Menus

Checkboxes and drop-down menus in the Administration Area are customized. Drop-down menus are styled using the Chosen library and checkboxes are styled with LemonStand back-end framework. In most cases customized checkboxes and menus work as normal controls, but there are a few cases when you need to call special JavaScript functions.

  • If you need to check or uncheck a checkbox programmatically, use methods cb_check(), cb_uncheck() or cb_update_state() of the checkbox element. Example:
    // Check the checkbox
    $('my-checkbox').cb_check();
    
    // Uncheck the checkbox
    $('my-checkbox').cb_uncheck();
    
    // Update the checkbox status to unchecked
    $('my-checkbox').cb_update_state(false);
    
  • If you need to enable or disable a checkbox programmatically, use methods cb_enable(), cb_disable() or cb_update_enabled_state() of the checkbox element. Example: 
    // Enable the checbox
    $('my-checkbox').cb_enable();
    
    // Disable the checkbox
    $('my-checkbox').cb_disable();
    
    // Update the checkbox status to disabled
    $('my-checkbox').cb_update_enabled_state(false);
    
  • If you disabled a drop-down menu or changed the selected option, call select_update() method of the SELECT element. Example: 
    // Update the drop-down menu selected option and disable the menu
    $('my-menu').selectedIndex = 0;
    $('my-menu').disabled = true;
    $('my-menu').select_update();
    


Previous: Lists and Forms in the Administration Area
Return to Adding a Back-End User Interface