GitHub Issue | n/a |
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-03-11T17:27:25.000+0000 |
Affected Version/s | Release 1.7.2, Release 1.8.0.1, Release 3.2.3 |
Fix Version/s | Sprint 2012-02, Release 2.0.0, Release 1.8.1, Release 3.2.0 |
Components | iOS |
Labels | module_tableview, parity, qe-testadded, supportTeam |
Reporter | Karol Pomaski |
Assignee | Vishal Duggal |
Created | 2011-09-15T08:50:15.000+0000 |
Updated | 2014-03-12T09:18:08.000+0000 |
Problem
Setting the data dynamically to the TableView makes it ignore the searchHidden property.
Reproducible Steps
1. Run the code
2. Press "press" button
Expected behavior
After using the setData() method within the tableView it should respect the previous searchHidden property set.
Remarks
The TableView instance was created with the property "searchHidden: true". It works correctly for the first time (the searchBar is hidden).
After setting the new data into the tableView using setData() method looks like it overrides the searchHidden property and sets it to FALSE. The searchBar is not anymore hidden.
Code
var win = Titanium.UI.createWindow({ backgroundColor:'#fff' });
var search = Titanium.UI.createSearchBar({
barColor:'#000',
showCancel:true,
height:43,
top:0,
});
var table = Titanium.UI.createTableView({
search:search,
searchHidden:true,
scrollable: true
});
var bt1 = Ti.UI.createButton({
title: "press",
width: 100,
height: 25,
bottom: 10,
left: 0
});
bt1.addEventListener("click",function(e){
var arr = [];
arr = [{title:"Row5"},{title:"Row 6"}];
table.setData(arr);
});
win.add(table);
win.add(bt1);
win.open();
Associated HelpDesk Ticket
http://appc.me/a/APP-912357
The tableView needs to set the searchHidden to true when the data is reloaded.
Setting the searchHidden property after the setData() method makes the searchBar to appear for a while. The point is to fix the TableView so that it would respect the searchHidden property that was set before. The searchBar should be hidden.
Tested with 1.9.0.v20120112104633 with iPod 4.3.3
Reopening for manual merge to 1.8.1.
Reopening for confirmation that the behavior we are seeing is expected. After clicking the button on the test app, the search bar is displayed then gets hidden. Is this the desired effect?
Kind of. We automatically display the search bar if it exists, then animate it out if it's supposed to be hidden. That's a separate bug but I can't remember the number for it offhand.
Have a pull request up for TIMOB-7273 that also fixes this issue. The search bar is now hidden without animation. https://github.com/appcelerator/titanium_mobile/pull/1211
for 1_8_X branch PR https://github.com/appcelerator/titanium_mobile/pull/1214
Fail - Tested with 1.9.0.v20120119134634 with iphone 4s (5.0.1), the table view now does not animate on update, but animates on launch.
Confirmed that the animation on launch is expected and been there since 1.7.5 and 1.8.0.1
Reopening since searchbar is visible when app launches also. After clicking press button also the searchbar is still visible.
TestEnvironment: Appcelerator Studio: 3.2.0.201311200357 SDK:3.2.0.v20131121163252 alloy: 1.3.0 acs: 1.0.7 npm: 1.3.2 titanium: 3.2.0-alpha titanium-code-processor: 1.1.0-alpha Xcode:5.0.2 OS: Mac OSX 10.9 Device: iphone5S(V7.0.2)
This issue can't be reproduced with TISDK 3.2 or higher. Therefore, marking it as resolved.
Reopening the issue as when pulling the tableview, searchbar is shown evenif the searchHidden property is set to true. Environment used: Device : iPod touch 2 , iOS version: 7.1 SDK: 3.2.3.v20140310185916 CLI version : 3.2.1 OS : MAC OSX 10.9 Alloy: 1.3.1 ACS: 1.0.14 npm:1.3.2 Appcelerator Studio, build: 3.2.2.201403061827 titanium-code-processor: 1.1.0 XCode : 5.1 Beta 5
That is expected behavior. searchHidden only controls if the searchBar is initially hidden from the user. The user can always pull down the tableView to see it and enter data.
Verified the fix, closing the issue as per the Vishal comment Environment used: Device : iPhone 5s , iOS version : 7.1 SDK: 3.2.3.v20140311115447 CLI version : 3.2.1 OS : MAC OSX 10.9 Alloy: 1.3.1 ACS: 1.0.14 npm:1.3.2 Appcelerator Studio, build: 3.2.2.201403061827 titanium-code-processor: 1.1.0 XCode : 5.1