How can I have possibility to choose which content should be displayed after row expanded. I need to be able to show if I just click on a row. But if I click pencil icon in the right side of the row I need to see on expand.
So i also don't know how to understand on expanding whether the pencil was clicked and what id of the row is so that I was able to display form according to data in the row.
I have an idea that expandedRowRender prop should be used. But couldn't reach the solution by far
Could be done by using two expanding Icons with different logics. But how?
Related
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 !
I'm using Material Table at the moment and am having difficulty customizing the position of the selection text (presented when one or more rows are selected via the checkbox).
Looking at the documents, I can see that the toolbar is overridable (https://material-table.com/#/docs/features/component-overriding), however the examples show simpler changes e.g. how to change the background color. I wonder if it's possible to separate the selection text from the toolbar and render it in a different location, like the below picture demonstrates.
Does anyone know if this is possible?
In the end, I turned off the row selection text in the toolbar by using showTextRowsSelected: false
I then made a custom footer using the row data presented by the onSelectionChange handler.
I have a 2 columns page and I want that on small screens the first column to be replaced by a small column with just a button on it. When you click the button the original first column appears again (like it is on Wordpress for example).
Thank you.
You cannot reduce a column into a button on a breakpoint (not without adding a lot of code), but you can:
Add a new column with class="column small-12 hide-for-medium", and put the button there... this will keep the column hidden from medium up.
The collapsible column (the first one) will have the class hide-for-small-only, so this will be hidden on small breakpoint; please add an id to this column.
Using jQuery, on the button click, hide/show the first column (the one with the ID, you sould use slideToggle() from jQuery), and that's it.
Hope this helps.
I have an ag-grid (free reactjs version) with lots of columns and records to load.
Some columns are not necessary, so the user can drag the columns out of the grid (and hence hide them). This is fine but how can the user show the hidden columns again without refreshing the page?
I don't want to suppress column drag, just a way to undo the hide without refreshing.
Any advice?
Shameless plug: The enterprise version has this feature in two places, Tool Panel and Column Menu.
However, thankfully it is rather easy to implement this feature yourself using a single columnApi call, well... one of these:
resetColumnState()
This will reset the state of the columns to what you initially defined them as. It will basically make everything visible again
setColumnVisible(colKey, visible)
Just pass in the colId of the column (usually what you passed in as 'field'... but it could be different depending on your set up) and a truthy or falsey value and this will show/hide the column
setColumnsVisible(<Array> colKeys, visible)
note the s - other than that it is the same as before, but you provide an array of colKeys that you want to all be hidden or shown. If you wanted to provide an array of all your columns with another array of whether they should be shown or not then use the last option here setColumnState
setColumnState(<Array> columnState)
This is probably overkill for what you are trying to do, but this will allow you to set the state of all the columns, whether they are visible or not, pinned to different sides, fixing the widths, etc.
Basically I can see you doing one of two things:
Create a button that will make all the columns visible and call gridOptions.columnApi.resetColumnState() when it is clicked
-- OR --
Create a list of check boxes that will listen for a change and call one of the other functions. This list could be outside of your grid, or even inside of your grid in a Custom Filter Component (find the athlete column of the first example to see what I mean.)
Another question for you Filemaker Pro experts. The database I am developing starts with a Main layout with a number of buttons (e.g. insert new item, show all items, etc.). Each button is associated to a script, which takes the user to the relevant layout. In each of these layouts I show the buttons in a row, and highlight the current layout with inverse colour.
My problem is that some of the buttons lead to the same layout, viewed in different modes, and I don't know how to conditionally highlight the right button.
For instance, Insert new item and Show all items take to the same layout, however in the first case the script views the layout as a form and inserts a new record, while in the second I view as a list and show all records. The layout is the same, though, so I'd need to enact a conditional formatting based on something. How do I do that, and what should I check against?
Thanks in advance for any help.
Regards.
Presumably you are currently using the formula: Get (LayoutName) to decide on your conditional formula, why not try additionally using formulas: Get(WindowMode) and Get(LayoutViewState)?
You could conditionally format the button if (which sends user to MyLayout in browse mode):
Get(WindowMode)=0 and Get(LayoutName)="MyLayout"
Or (which sends user to MyLayout in form view):
Get(LayoutViewState)=0 and Get(LayoutName)="MyLayout"
.
Other functions which may help could be Get(FoundCount) and Get(TotalRecordCount). You can see the entire list of Get functions here.