I'm using magento v2.2.5 and i created a column with inline edit like this:
xml ui component
<column name="enabled">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">text</item>
<item name="label" translate="true" xsi:type="string">Enabled</item>
<item name="editor" xsi:type="string">select</item>
<item name="options" xsi:type="object">Namespace\Module\Model\Source\EnabledOptions</item>
</item>
</argument>
</column>
Namespace\Module\Model\Source\EnabledOptions
namespace Namespace\Module\Model\Source;
class EnabledOptions implements \Magento\Framework\Option\ArrayInterface
{
public function toOptionArray()
{
$result = [];
foreach (self::getOptionArray() as $index => $value) {
$result[] = ['value' => $index, 'label' => $value];
}
return $result;
}
public static function getOptionArray()
{
$options['yes'] = __("Yes");
$options['no'] = __("No");
return $options;
}
public function getAllOptions()
{
$result = [];
foreach (self::getOptionArray() as $index => $value) {
$result[] = ['value' => $index, 'label' => $value];
}
return $result;
}
public function getOptionText($optionId)
{
$options = self::getOptionArray();
return isset($options[$optionId]) ? $options[$optionId] : null;
}
}
but i got an empty options like this:
edit:
after i inspected the browser console, there is an error like this: