code: function(dataprovider) {
  
              var groupCounter = 0;
              var $select = this.$select.empty();
  
              $.each(dataprovider, function (index, option) {
                  var $tag;
  
                  if ($.isArray(option.children)) { // create optiongroup tag
                      groupCounter++;
  
                      $tag = $('<optgroup/>').attr({
                          label: option.label || 'Group ' + groupCounter,
                          disabled: !!option.disabled
                      });
  
                      forEach(option.children, function(subOption) { // add children option tags
                          $tag.append($('<option/>').attr({
                              value: subOption.value,
                              label: subOption.label || subOption.value,
                              title: subOption.title,
                              selected: !!subOption.selected,
                              disabled: !!subOption.disabled
                          }));
                      });
                  }
                  else {
                      $tag = $('<option/>').attr({
                          value: option.value,
                          label: option.label || option.value,
                          title: option.title,
                          selected: !!option.selected,
                          disabled: !!option.disabled
                      });
                  }
  
                  $select.append($tag);
              });
  
              this.rebuild();
          }
docs: The provided data will be used to build the dropdown.