Home AJAX Modal Accordion fillComboBox

TMJRock - fillComboBox Utility

This page demonstrates how the fillComboBox function automatically generates dropdown options from an array of JSON objects.

1. Fill using a Local Array

Instantly map an array of JavaScript objects to a dropdown.


$$$("localCombo").fillComboBox({
  "dataSource" : staticDesignations,
  "text" : "title",
  "value" : "code",
  "firstOption" : {
    "text" : "< Select IT Role >",
    "value" : "-1"
  }
});

2. Fill using $$$.ajax (Live Database)

Fetch designations from the live MockAPI database and populate the dropdown.


$$$("dbCombo").fillComboBox({
  "dataSource" : designationsFromAPI,
  "text" : "title",
  "value" : "code",
  "firstOption" : {
    "text" : "< Select Designation >",
    "value" : "-1"
  }
});