How to add multiple rows to Data Grid simultaneously?

Markku shared this question 6 years ago
Answered

I managed to add data to a data grid row by row each time I press a button.


I need to add different data from (= many rows) a checkbox group when a button is pressed once. So the user may select many checkboxes from the group and then he will press 'Add' button. Each selected checkbox value needs to create a new row in the data grid.


How is this done?

Comments (4)

photo
1

By 'checkbox group' you mean the input widget 'check list' or just a group of single checkboxes? If it's a group of single checkboxes I would add an onclick event on each of them so that if it's clicked it creates a new row in the data grid and if it's not clicked it removes it. Then the button will have just a set value event to refresh the data grid.

photo
1

It is a input widget 'check list'.


Currently this creates one row at a time and the new data is a combination of checked items, separated by commas.


My goal is to create one row per each checked item. Preferably after pressing an "Add" button.


Also, please tell me how do I empty this checklist form? This form is in a lightbox. So each time I exit the lightbox I want it to be cleared.

photo
1

You can take a look at this prototype http://justinmind.s3.amazonaws.com/ad...

photo
1

Thank you, this is just what I wanted!