1
votes

Does anyone know if there is a way to manually (javascript) populate/manipulate a grid in appmaker? The situation is that a list of skills is stored in a single comma delimited string field in a table (i.e. "MS Word, MS Excel, MS Access") and I would like to use a grid to represent each skill in an individual cell in a grid widget and then add/delete them using the grid, similar to the Company services in the Vendor example. Then reassemble the grid items into a single comma delimited string and save them back to the record.

I can't get grid to work without a datasource. I would prefer not to put Skills in a separate table joined to the employee table. It seems like overkill.

Thanks for all advice!

2
I came up with a way to do this, but it would be somewhat lengthy to explain it here. It is using a datasource parameter which uses a string of skills separated by commas stored in EmployeeSkill field. The onItemChange event takes the field string and uses the split() function to create a object written to parameter. But basically everything is done client side. If you would like to see the sample app reply here and we can figure out how I can get you the exported application. - Markus Malessa
Hi Markus, thank you for your response. I would love to see how you did this solution. I did come up with a solution using a Calculated Model and a Query Parameter to feed the Calculated Model, but the downside is it needs to refresh the query every time the grid contents need to be changed, which is not as responsive as I would like. - HDN
Are you on the App Maker User Group? I can attempt to share the export of the sample app there, not sure how to do it on Stack Overflow. It would be simpler sharing the app than listing all the steps and logic attached to each element in the answer. - Markus Malessa
Yes, I am on the App Maker User Group (Google Groups). I really appreciate your efforts. - HDN

2 Answers

2
votes

The short answer is that a grid widget requires a datasource. However, you can create a datasource parameter or a page parameter of type List and set your grid datasource equal to this parameter. Then you can use client scripts to manipulate the datasource and read or write it back to your datasource field using string to object conversions and using object to string conversions, however your field must have a string separator like a comma or similar that is used as a parser when converting between string and object. An App Maker application export file for an example is posted here: https://groups.google.com/forum/#!topic/appmaker-users/G3UIPRRAR60.

0
votes

populate

It is pretty easy to render some data, that lives outside your data models(Drive Tables/Cloud SQL). You can use Calculated Models to fetch data from any 3rd party source and then render it within App Maker. But there are at least two downsides of this approach:

manipulate

  1. Calculated Models are read only, so if you bind it to input widgets widgets(Textbox, Dropdown, Checkbox...) App Maker won't let you to edit underlying JS objects...

  2. Calculated Models don't support relation data.