'How to override form in magento 2 (uiComponent)

I have form declared as uiComponent(custom module). I have to disable top menu button based on some status. The button is in structure

<form>
<argument name="data" xsi:type="array">
 <item name="buttons" xsi:type="array">
            <item name="save_and_continue" xsi:type="array">
                <item name="name" xsi:type="string">save_and_continue</item>
                <item name="label" xsi:type="string" translate="true">Save and Continue Edit</item>
                <item name="class" xsi:type="string">save_and_continue</item>
            </item>
....
</item>
....
</form>

I try to create observer to remove element from view but using $layout->unsetElement('save_and_continue') not work. I found that there is some think like PHP modifiers in UI components but i cant get this right from tutorial provided in doc.

How can i remove remove such item ? It can`t be static xml to override this one because i have some dynamic parameters.



Solution 1:[1]

I end up doing is to override with my own class.

<item name="save_and_continue" xsi:type="string">
  class\namespace....
</item>

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 user2217288