[TIMOB-15451] iOS: ListView with custom Template in navigationWindow : listItems not displayed first time when calling appendSection()
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Medium |
| Status | Closed |
| Resolution | Duplicate |
| Resolution Date | 2013-11-18T18:49:21.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | Release 3.2.0 |
| Components | iOS |
| Labels | iOS7, listview, qe-closed-3.2.2 |
| Reporter | Vincent |
| Assignee | Shak Hossain |
| Created | 2013-10-10T07:24:07.000+0000 |
| Updated | 2014-03-10T08:50:25.000+0000 |
Description
After setting a ListView with custom template in a navigation window, the listItems are not correctly displayed first time when you use appendSection().
Titanium SDK version 3.2.0.v20131009134844 : KO
works with 3.1.4
See below for test case.
TEST CASE click on 'dataset' to display the listView in the second window: result : Section not displayed Go Back click again on dataset: the Sections are displayed
detailTemplate = { childTemplates: [ { type: 'Ti.UI.Label', bindId: 'theName', properties: { color:'black', font:{fontSize:14,fontWeight:'bold'}, top:1, left:8, } }, { type: 'Ti.UI.Label', bindId: 'theCategorie', properties: { color:'darkGray', font:{fontSize:14,fontWeight:'bold'}, bottom:1, left:8, } }, ] }; var b1 = Ti.UI.createButton({ title : 'dataset1', top:20, }); b1.addEventListener('click', function() { var data1 = [ { theName: { text: 'Row 1'},theCategorie:{ text: 'Cat 1'} }, { theName: { text: 'Row 2'},theCategorie:{ text: 'Cat 2'} }, { theName: { text: 'Row 3'},theCategorie:{ text: 'Cat 3'} } ]; var listSection1 = Titanium.UI.createListSection({items: data1,headerTitle: 'Data1 Custom Item Template'}); listView.appendSection(listSection1); rootWin.openWindow(win2); }); var win1= Ti.UI.createWindow({title:'Custom Item Template'}); win1.add([b1,]); var win2 = Ti.UI.createWindow(); var listView = Titanium.UI.createListView( {templates: { 'detailTemplate':detailTemplate }, defaultItemTemplate: 'detailTemplate', } ); listView.addEventListener('itemclick', function(e){ //alert ( JSON.stringify(e)); Ti.API.info(JSON.stringify(e)); var item = e.section.getItemAt(e.itemIndex); Ti.API.info(JSON.stringify(item)); }); win2.add(listView); var rootWin = Ti.UI.iOS.createNavigationWindow({window:win1}); rootWin.open();ListView with custom template working fine. Hence closing the issue. Used the below mentioned code to test. Appc Studio:3.2.2.201402280732 Sdk:3.2.2.v20140305122111 alloy:1.3.1 titanium:3.2.1 titanium-code-processor:1.1.0 Xcode: 5.1 Beta 5 Osx: Maverick(10.9.2) Device:iPod Touch3(v7.1 beta5)