<div class="form-group form-group-flex delivery-select">
   <label>Geis Point</label>
   <div>
      <select class="selecter-categories pull-right" name="data[delivery_data][geispoint_id]" data-type="geispoint">
         <option value="0">-- Nevybráno --</option>
         <option value="{$info['id']}" selected>{$info['id']} - {$info['city']}, {$info['street']}, {$info['name']}</option>
      </select>
   </div>
</div>

<script type="text/javascript">
   $('.selecter-categories[data-type=geispoint]').ajaxChosen({
      dataType: 'json',
      type: 'GET',
      url: '/autocomplete/?type=delivery_geispoint'
   }, function (data) {
      new_data = [];
      data.forEach(function (row, i) {
         new_data[i] = {
            text: row.value + ' - ' + row.name,
            value: row.value
         };
      });
      return new_data;
   }, {
      width: '300px',
      placeholder_text_single: 'Vyberte možnost'
   });
</script>
