Problem with grouped view
Hi,
I'm using source code from the KitchenSink in my app.js and I am always getting the following error when running my app.
[ERROR] Script Error = Result of expression 'Titanium.UI.iPhone.createGroupedSection' [undefined] is not a function. at app.js (line 1).
3 Answers
-
post the code is giving you troubles
-
var win = Titanium.UI.currentWindow; var buttonData = [ {title:'Button 1'}, {title:'Button 2'}, {title:'Button 3'} ]; var buttonSection = Titanium.UI.iPhone.createGroupedSection({ footer:'Button Footer', header:'Button Header', type:'button', data:buttonData }); var groupedView = Titanium.UI.iPhone.createGroupedView(); groupedView.addSection(buttonSection); win.add(groupedView);
-
I believe the following files were included in KitchenSink by mistake:
grouped_view_basic.js
grouped_view_layout.js
grouped_views.js
The
createGroupedView
andcreateGroupedSection
functions are from earlier versions of Titanium and are no longer supported.In the most recent version you create grouped views with
createTableView
by setting thestyle
property toTi.UI.iPhone.TableViewStyle.GROUPED
.See
table_view_api_grouped.js
for a working example.