Question

I have used the below code in view :

<exportButton name="export_button">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="selectProvider" xsi:type="string">pos_outlet_listing.pos_outlet_listing.pos_outlet_columns.ids</item>
                </item>
            </argument>
</exportButton>

Got Error:

Notice: Undefined index: attributes in /home/yaboow/public_html/demo/vendor/magento/framework/View/Element/UiComponentFactory.php on line 176

version 2.3

Is there anything i have missed!!?

Was it helpful?

Solution

       <!-- <selectionsColumn name="ids"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> <item name="resizeEnabled" xsi:type="boolean">false</item> <item name="resizeDefaultWidth" xsi:type="string">55</item> <item name="indexField" xsi:type="string">id</item> </item> </argument> </selectionsColumn> -->

You just need to remove comment form above code. Because UiComponentFactory.php take Data of array from it and pass this data to it's parent

     public function __construct(
    ObjectManagerInterface $objectManager,
    ManagerInterface $componentManager,
    InterpreterInterface $argumentInterpreter,
    ContextFactory $contextFactory,
    array $data = [],
    array $componentChildFactories = [],
    DataInterface $definitionData = null,
    DataInterfaceFactory $configFactory = null
) {
    $this->objectManager = $objectManager;
    $this->componentManager = $componentManager;
    $this->argumentInterpreter = $argumentInterpreter;
    $this->contextFactory = $contextFactory;
    $this->componentChildFactories = $componentChildFactories;
    $this->configFactory = $configFactory ?: $this->objectManager->get(DataInterfaceFactory::class);

parent::__construct($data);

            $this->definitionData = $definitionData ?:
        $this->objectManager->get(DataInterface::class);
}

And it's parent class

Magento\Framework\DataObject

data set in SetData function

OTHER TIPS

Check if yo have selection columns, if not add this

    <selectionsColumn name="ids">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="resizeEnabled" xsi:type="boolean">false</item>
                <item name="resizeDefaultWidth" xsi:type="string">55</item>
                <item name="indexField" xsi:type="string">id</item>
            </item>
       </argument>
    </selectionsColumn>
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top