Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23641] Windows: list section instertItemsAt not working

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2016-07-18T02:29:42.000+0000
Affected Version/sn/a
Fix Version/sRelease 6.0.0
ComponentsWindows
Labelsn/a
ReporterZakhar Zhuravlev
AssigneeGary Mathews
Created2016-06-29T17:40:34.000+0000
Updated2016-08-22T16:14:28.000+0000

Description

I want to add row to the top pf the list (0 index of row), but instead of this section adding row to the end. index.xml:
<Alloy>
    <Window id='win' backgroundColor="green">
		  <ListView id="list" defaultItemTemplate="t">
		  	<Templates>
					<ItemTemplate name="t" >
						<Label bindId="label" />
					</ItemTemplate>					              
			</Templates>
		    <ListSection  id="section">
		    </ListSection>
		  </ListView>
		  <Button backgroundColor='red' width='100dp' height='44dp' onClick='doClick' />
    </Window>
</Alloy>
index.js:
function doClick(e) {
    $.section.insertItemsAt(0, [{label: {text: 'test4'}}]);
}

$.section.appendItems([
	{label: {text: 'test1'}},
	{label: {text: 'test2'}},
	{label: {text: 'test3'}},
]);

$.win.open();

Comments

  1. Gary Mathews 2016-07-15

    master: https://github.com/appcelerator/titanium_mobile_windows/pull/780
  2. Zakhar Zhuravlev 2016-07-15

    by the way, it's not working for scrollview as well.
  3. Ewan Harris 2016-08-22

    Verified using: Windows 10 Pro Appc core: 6.0.0-26 Appc NPM: 4.2.8-5 Ti SDK: 6.0.0.v20160822001523 Lumia 930: 10.0 Luma 520: 8.1 List section insertItemsAt now functions correctly Closing ticket

JSON Source