LemonStand Documentation

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