Add Record to Data Grid

In thinking about this question, imagine you are using Microsoft Excel or some other spreadsheet application. In Excel, you can add data in the row beneath the bottom-most populated row simply by selecting the cell and entering data. I'm very new to Mendix and don't know much of anything. Is it possible to add new rows on-the-fly to data grids? I know how to create a page that allows records to be added one at a time, but I'm dealing with a very simple data grid with only two columns of data and I want to be able to add them rapid-fire style rather than having to click the new button each time. Thoughts are greatly appreciated.
2 answers

I think you can accomplish the same (more-or-less) with a template gird.

You'll need to create an empty object (row) whenever the user navigates to the page where the template grid is on (with no records available) and/or create a new empty object whenever you save the previous one. (either with a button, before/after commit or a on-change microflow) This in combination with some editable data fields could provide you a similar solution as your suggestion.


Hi Aaron,

Very good question. I think that Mendix's prefered way of creating new objects is with a new button and a popup window like in the tutorials. This is made even easier with the option to autogenerate such a popup page, when you right click on the New button.


However there is a way to accomplish what you want and Jordy already explained that. Just to illustrate this here is a screenshot of such a setup in the modeler

Here is a link to the on leave microflow so that you can see what is happening inside the actions and checks


Here is what the end result looks like:

No buttons you just fill in the fields and the objects get added to the grid. Add some css on top of that and the user won't notice the difference.


Hope this helps,