Is there a way to add multiple rows to a dataview using row-add or some other widget? The JSON editor in the row-add widget allows you to add a single row. I tried to make it into an array but that did not work. I looked at using the dataview-condition described here and some how using iteration call a separate event that has a row-add widget but the data would need to come from somewhere other than the source dataview. It appears the “Expression” uses data found in the source dataview? This is for an unusual use case so I’m not sure its possible out of the box.
I’ll try. Its a bit convoluted. I am working on a product configurator. I need for the end user to be able to add, remove and clear part numbers in a grid. The part numbers are returned ,on the fly, from a function call using the rest-erp widget. I created dataviews similar to the Trans view to hold/bind to the grids. The grid data is kept in sync with the text boxes, that are tilde separated values, with a grid change event. The text boxes values are actually what is used during the rules portion of the configurator but I need a way to add/remove/clear the text boxes so I used datagrids. It actually works well. The problem comes in when the user has to reenter a previous configuration the data in the grid is gone since its not backed by a service call or BAQ. So what I did is after the page “is loaded” event I am calling a row-add to fill the dataview/grid with what is in the corresponding text boxes. This works if there is only one item. If there are more I need to be able to add those also.
I was able to accomplish my goal with your help. I load the grids by calling an event on the page loaded event. That event sets a counter to be the total number of tilde separated items in the first text box , of each grid, then calls another event that checks the counter to see if it is zero if not it does a row-add ,accessing the item by the index of the counter, then does a row-update to decrement the counter then calls itself(recursion) until the condition is false. I then do a row-update to reset the counter for the next grid and call the event to kick it off. I even added a refresh button on the grid to manually reload although you can’t see it refresh when I click the refresh button below.