GridList Widget: Error Could not parse rendered template as JSON….
-
Alex KHas successfully completed the online course Intermediate (200)Has successfully completed the online course Advanced (300)Has successfully completed the online course Basics (100)Has successfully completed the online course Advanced (310)Has successfully completed the online course Advanced (320)1 year ago #38554
Fehler beim Deployment: Error building files: Error rendering screen item f_GridList1 on screen Capacity_Planning_Overhaul: Could not parse rendered template as JSON: expected field or array but got IntermediateJObject(ListBuffer(JField(path,JString({variableHolder>/test})), JField(template,JString(templateShareable))))
Near: hareable”: trueI use an Array-Object-List as input. Any way to use that widget as itemsTemplate + itemsPath is failing.
I need the group-feature though, and I thought, I could create my own widget with the feature in mind.
Using Datasource is not an option, as this is a List-Object and I do not need multiple instances.Jennifer HäfnerHas successfully completed the online course Intermediate (200)Has successfully completed the online course Advanced (300)Has successfully completed the online course Basics (100)Has successfully completed the online course Advanced (310)Has successfully completed the online course Advanced (320)Has successfully completed the Intermediate CertificationHas successfully completed the Advanced Certification1 year ago #38577::Hi Alex,
I understand that you are facing problems when configuring a GridList? When you want to display an array of objects in a list, you can use the data source feature, as it will dynamically generate a list item for each object.
If you don’t want to use the data source, you can store your array-object-list in a global variable and define the path to the global variable in the GridList’s property ‘itemsPath’ (also, set ‘itemsTemplate’ to true). Then, in the widgets inside the GridListItem, define the values that you want to display in the manual mapping. I added screenshots to show you the configuration.
If this is not your issue, please elaborate further which problem you are facing.
Attachments:
You must be logged in to view attached files.Alex KHas successfully completed the online course Intermediate (200)Has successfully completed the online course Advanced (300)Has successfully completed the online course Basics (100)Has successfully completed the online course Advanced (310)Has successfully completed the online course Advanced (320)1 year ago #38596::Thank you, this is working now. I used the data source feature before.
But How do I use the sap.ui.model.Sorter in that widget?
Do I need to update the version or modify the widget?
I cannot seem to get this working with the built-in UI5 1_71 widget, as it does not have the sorter defined.<f:GridList id="gridList" items="{ path: '/items', sorter: { path: 'group', descending: false, group: true } }" growing="true" growingThreshold="9">
Jennifer HäfnerHas successfully completed the online course Intermediate (200)Has successfully completed the online course Advanced (300)Has successfully completed the online course Basics (100)Has successfully completed the online course Advanced (310)Has successfully completed the online course Advanced (320)Has successfully completed the Intermediate CertificationHas successfully completed the Advanced Certification1 year ago #38610::Grouping the list items with a Sorter works via JavaScript code. Insert this snippet after you have loaded your data for the list (adapt the list ID and the path):
var oSorter = new sap.ui.model.Sorter({ path: 'group', // the path to the feature that you want to group the list items by descending: false, group: true }); sap.ui.getCore().byId("Screen2--f_GridList1").getBinding("items").sort(oSorter);
You must be logged in to reply to this topic.