2 year anniversary

Using Combobox


PageHome.ts

import V = require("VCL/VCL");
 
export class PageHome2 extends V.TPage {
   constructor() {
      super();
      var combo = new V.TCombobox(this, "cob");
 
      //add key value to the combobox
      var col1 = combo.createItem("1", "James Harden");      
      combo.createItem("2", "doctor j");
      combo.createItem("3", "larry bird");
      combo.createItem("4", "Kevin Durant");
      combo.createItem("5", "Jacob");
      combo.createItem("6", "Mason");
      var col2 = combo.createItem("7", "Ethan");
      combo.createItem("8", "Noah");
      combo.createItem("9", "William");
 
      combo.LabelVisible = true;
      combo.LabelText = "Players";
      combo.FitToWidth = true; //combo will take the 100% of parent width.
 
      combo.MultipleSelect = true;
      combo.SelectedItems = [col1, col2];
 
      combo.onChanged = () => {
         //get the currently selected record
         var arr = combo.SelectedItems;
 
      }
   } 
}
 

PageHome.html

<div style="width:100px">
    <div id="cob"/>
</div>

This entry was posted in Code Snippet and tagged . Bookmark the permalink.