How Do I Expand A Cell in MUI-Datatables to display additional content? - mui-datatable

I want a user to be able to click a row in the MUI-Datatable, so they can see additional content. The current renderExpandableRow function has the right styling, but I don't want a new row. I want the cell in the first column to show additional data. Is there a way to do this?
Note: I'm also going to need buttons that will expand all/collapse all, so I need a solution flexible enough to do that.

I found a solution to my question.
I made the first column's content a Button using customBodyRender. The column with expandable content became the second column. This column has a customBodyRender with a Collapse component. I store in my component's state all ids of my data objects and whether or not they are expanded. When the Button is clicked, my component's state is updated, which in turn changes whether or not the Collapse component is open.
I also used customToolbar in the table options to generate an expand all/collapse all button, which just sets the state of all rows to expanded/collapsed.

Related

Vue.js handling back button on crud navigation

I have a search form that fills a table with the results of an API query. Each item on the table have an edit button. When the user click on that button, a view is showed, with the detail of the item. The problem is when I want to go back to the list, I lost the last search result. What is the best way to solve this problem?
I see two approaches: In first one, I save the results of the query through Vuex, but I dont know if Vuex is used to save large amount of data. On the second approach, I show/hide the components instead of change the route: when I want to edit an item, I hide the table and show the edit view. When I want to go back to the list, I hide the edit view and show the table. Is there another way to solve this problem?
Thanks in advance.

ListGrid column change event

I have requirement to create a custom ListGrid, where user can show, hide, filter a column. also can change width and reOrder column and even color it and sort direction.
I know that list grid provide all this facility to user.
But I have to save all these changes and user will get this things back when they login again.
Is there any event which record all changes??
And how to get all this data from listGrid??
​Thank you.
You could use ListGrid.viewStateChanged():
Notification method executed whenever the viewState of this grid
changes. View state is accessible via ListGrid.getViewState(), and
contains field state information, sort information, selection
information, hiliting information and grouping information.

Displaying a field in a column with a fallback option to another field

I'm creating a view for Contact entity and the issue is that some of their sellers have entered information on Mobile Phone field, while others used Business Phone field.
They'll probably continues to do so. There's no point copying the values as they're entered and both fields are needed.
The simplest solution is to display two columns in the view. However, that occupies the precious width on the form.
I wonder if it's possible to display a column in a view so that it gets its information from field Ahaa and if that happens to be empty, it falls back to displaying the field Buhu. Is it possible and if so - how?
There's no supported way to add conditional logic to a view definition such that it would show or hide columns. The usual way to do this is to store the value of whichever field is populated in third field. Populate this in a plugin and show this only in the view.

Dojo call template on change of layout

I'm quite new to Dojo and trying to accomplish a table widget. I have a widget that contains the actual table element and generates it´s headers. Then I have one widget that is called to create each row and fill it with information.
The thing I'm struggling with is that I want each row to be clickable and on the click event I want to re-render the contents of the row and add some data to it.
Is there any way to have a second template file that I can call on the click event to change layout of the row?

Searching through DataGridView

I have a datagridview with three columns (ID, Name, Address). It's bound to a database that contains around 500 items.
I want to be able to search the gridview for data given in a text box, and then highlight it.
If possible, pressing the Next button should find the next match, and the Reset button should clear all selections (nothing highlighted).
Please advise how to do it.
Thank you very much.
Add a search box and search button in the page. OnClick of the search button, search the datatable for the results and keep the result in the session. then on the bound event of grid, highlight the first row of from the search result set (which can be done by matching the primary/unique key of the table).
You have to handle most of code the manually for this. OnClick of next button, highlight the next row from the search result. again traversing of the search result has to handled manually like keeping the track of current result, moving to next result or moving backward etc.
then on click of reset button clear the search result session and bind the grid again without any highlighted rows.
I don't have code to post for you right now. but i hope if you implement this approach surely your problems will be resolved.