if ($this->getAttribute('default') !== null && $this->getAttribute('allows_null')) {
$this->setAttribute('allows_null', false);
}
- if ($this->getAttribute('ajax', false)) {
- $this->setAttribute('ajax', self::hashOptions($this->getOptions()));
- }
}
public static function hashOptions($options)
parent::_preGetDefinition();
$o=$this->_getOptions();
$this->setAttribute('options', $o);
- if ($this->getAttribute('ajax', false)) {
- $this->setAttribute('ajax', SelectFromArray::hashOptions($o));
- }
-
}
public function _postSetAttributes()
}
$ajax=isset($field['ajax']) && $field['ajax'];
+
+if($ajax){
+ $field['ajax']=\Cubist\Backpack\Magic\Fields\SelectFromArray::hashOptions($field['options']);
+}
@endphp
<!-- select2 from array -->