getAllAvailableKeys Method

Summary

Retrieves all keys that are supported in the version of LEADVIEW.

Syntax
TypeScript
JavaScript
BindingManager.prototype.getAllAvailableKeys = function() 
getAllAvailableKeys(): string[]; 

Return Value

An array of strings pertaining to key values.

Remarks

The BindingManager.getAllAvailableKeys() method allows you to retrieve all bindable keys that exist in the version of LEADVIEW you are working with. These key values may change between versions.

All bindable keys adhere to a logical naming scheme, and will end according to the UI component it belongs too. For example, the AnnRectangleObject object selector's associated binding key is rectangleAnn. An object from the main menu (for instance, the Open From Url button) has a binding key of openUrlFileMenu.

For more information about key support, refer to isSupported().

Example
BindingManager.ts
BindingManager.html
export class BindingManagerExample { 
   public constructor() { 
      if (lt.RasterSupport.kernelExpired) 
         lt.RasterSupport.setLicenseUri("https://demo.leadtools.com/licenses/js/LEADTOOLSEVAL.txt", "EVAL", null); 
 
      this.rebind(); 
   } 
 
   public run = (divID: string): void => { 
      const lv = new lt.LEADVIEW.Viewer(); 
 
      lv.run(null, { 
         'rootDivId': divID 
      }); 
   } 
 
   public rebind = () => { 
      /** 
       * The BindingManager handles overwriting any default LEADVIEW button functionality. 
       * We recommend that you setup bindings before calling LEADVIEW.run(); 
       */ 
      const manager = lt.LEADVIEW.BindingManager.Instance; 
 
      /** 
       * The binding contract to apply to one of LEADVIEW's components. 
       */ 
      const binding: lt.LEADVIEW.LVBinding = { 
         onClick: () => alert('Custom Click!'), 
         tooltip: 'Custom Tooltip!', 
         class: 'lv-custom-class' 
      }; 
 
      /** 
         * A full list of all keys available for binding can be retrieved by calling 
         * BindingManager.getAllAvailableKeys().  This will return an array of all available keys. 
         * To check and see if a key is supported in LEADVIEW, just call BindingManager.isSupported(). 
         * 
         * Any string key value can be set in the manager, but the key will only be consumed internally by LEADVIEW 
         * if isSupported = true. 
         * 
         * For the purposes of this example, we will just loop through every available key, and apply our custom binding. 
        */ 
      manager.getAllAvailableKeys().forEach(key => { 
         if(!manager.isSupported(key)) return; 
 
         manager.add(key, binding, true); 
      }); 
   } 
} 
<!doctype html> 
<html lang="en"> 
    <title>LV Examples | Binding Manager</title> 
    <head> 
        <script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script> 
 
        <script src="../LT/Leadtools.js"></script> 
        <script src="../LT/Leadtools.Controls.js"></script> 
        <script src="../LT/Leadtools.Annotations.Engine.js"></script> 
        <script src="../LT/Leadtools.Annotations.Designers.js"></script> 
        <script src="../LT/Leadtools.Annotations.Rendering.Javascript.js"></script> 
        <script src="../LT/Leadtools.Annotations.Automation.js"></script> 
        <script src="../LT/Leadtools.ImageProcessing.Main.js"></script> 
        <script src="../LT/Leadtools.ImageProcessing.Color.js"></script> 
        <script src="../LT/Leadtools.ImageProcessing.Core.js"></script> 
        <script src="../LT/Leadtools.ImageProcessing.Effects.js"></script> 
        <script src="../LT/Leadtools.Document.js"></script> 
        <script src="../LT/Leadtools.Document.Viewer.js"></script> 
        <script src="../LT/Leadtools.LEADVIEW.js" defer></script> 
        <link href="../css/Leadtools.LEADVIEW.css" type="text/css" rel="stylesheet"> 
 
        <!-- All typescript files compiled from /src/ will be bundled and dropped into the root folder `bundle.js`--> 
        <script src="../bundle.js" type="text/javascript"></script> 
    </head> 
    <body> 
        <div id="runDemo" style="width: 100%; height: 100vh;"></div> 
    </body> 
 
    <script> 
       window.onload = () => { 
         const example = new window.examples.BindingManagerExample(); 
         example.run("runDemo"); 
      }; 
    </script> 
</html> 
Requirements

Target Platforms

Help Version 22.0.2023.1.31
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.LEADVIEW Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.