How do I get Panel key when I click on extraIcon and the panel is active is Antd Collapse component? - reactjs

I have a situation, where I need to get the panel key when I click on extra icon (present beside expand arrow/collapse arrow) for the requirement posted below.
When I click on icon, I should remove that panel and add it to the right and vice-versa. To do that, I need to get panel key which I get when Panel is not in active state in onChange callback function, but don't get the same when the panel is active.
How do I do this? Please let me know

In the specific case wanted by #anup-r (modifying an antd sample) it is necessary to pass to the genExtra function the key of the panel
See updated sample

Related

Toggle ExpansionPanel expand/collapse via ref

I am using react material-ui v4.9 in my project and have multiple ExpantionPanels.
I would like to define a ref for each and have a top level button on my page to let use user Expand All and Collapse All via one click. On that click event, I would like to use the refs for each panel and either collapse or expand them all.
Is that something that is possible?
I see that the panel has an expanded property that maybe I could set to true or false, but I think that will get out of sync if the user expand or collapses some panels. Also, some panels have the defaultExpanded property turned on as well.

How can I disable the radio button of the last column visible in DataGrid MUI( column panel)?

I don't know if it's possible, but I want on columns Panel- DataGrid, that when only one column is visible, I can no longer click on the button to hide it. For example, in the attached picture, the button for Column3 should be disabled, so that I cannot hide it. I searched in the documentation but did not find certain props that would help me. . Do you think this is possible or are there certain props that would help?
Thank you !

Ag-Grid keep custom filter open during interaction with dropdown

I have a custom filter component I'm giving Ag grid for each column. The component contains a dropdown. When user selects an option from dropdown, the filter closes immediately on selection rather than staying open like it should.
How can I keep the filter component to stay open on selection of option from dropdown?
Reading the docs more, I found the answer here:
https://www.ag-grid.com/javascript-data-grid/component-filter/#custom-filters-containing-a-popup-element
Custom Filters Containing a Popup Element
Sometimes you will need to create custom components for your filters that also contain popup elements. This is the case for Date Filter as it pops up a Date Picker. If the library you use anchors the popup element outside of the parent filter, then when you click on it the grid will think you clicked outside of the filter and hence close the column menu.
There are two ways you can get fix this problem:
Add a mouse click listener to your floating element and set it to
preventDefault(). This way, the click event will not bubble up to the
grid. This is the best solution, but you can only do this if you are
writing the component yourself.
Add the ag-custom-component-popup CSS
class to your floating element. An example of this usage can be found
here: Custom Date Component

Antd table expand row and place textarea inside

I am trying to implement row editing with Antd where when I click on the Edit link the row expands and has a textarea inside the user can type into. I haven't been able to figure out how to trigger row expansion (didn't see any onclick event handlers on the + sign) nor how to get access to the expanded row element to slide a form field in there in a non hacky way.
This is the current code - https://gist.github.com/llevar/8f9a68bcc15ab0e37defb14a5126c5ad. The goal is to have the column "Configuration" with JSON in it end up in a text area upon clicking Edit.
Thanks in advance.
Did you try
onExpandedRowsChange props and onExpand they give you access to the expanded row callback and expanded row change.
edit:
I haven't try this, but I think you should be able to programatically expand rows with expandedRowKeys and state. and use the expandedRowRender to conditionally render "view mode" and "edit mode(text area)", also you can add a save button to save the textarea values and turn it back to "view mode"
onExpand is trigger when you press the + icon (or expand the row via rowClick)

Component as grid emptyText in ExtJS?

I want to display a component as emptyText for a grid, the ExtJS documentation states that only HTML can be shown.
For example a button that pop-ups a create window, as shown below:
Is there a workaround to use a component in a grid, or perhaps even a config that I'm missing?
Of course you can do that, just that you will have to debug a lot in order to see how to do that. That's why I have an alternative: add a hidden docked toolbar with your "Create new employee" button. Then add an listener for the load store event, and when no records are available, simply show the toolbar, otherwise hide the toolbar.

Resources