[TIMOB-20448] Android: Adding text color to a singular row adds the color to multiple down the list
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-02-27T01:54:32.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 6.1.0 |
Components | Android |
Labels | qe-6.1.0 |
Reporter | Josh Longton |
Assignee | Frankie Merzadyan |
Created | 2016-02-23T23:44:36.000+0000 |
Updated | 2017-05-31T22:29:38.000+0000 |
Description
Adding text color to a singular row adds the color to multiple down the list.
*Steps to reproduce:*
Use the app.js file below.
*Actual :* Multiple rows have red text and it keeps changing. *Expected:* Only the first row should have red text *App.js*
var win = Ti.UI.createWindow({
backgroundColor: 'black',
});
var array = [];
for (var i = 0; i < 501; i++) {
var obj = {
title : "Row "+ i
};
if (i == 0) {
obj.color = 'red';
}
array.push(obj);
}
var tableview = Titanium.UI.createTableView({
data: array,
});
win.add(tableview);
win.open();
Not a bug. This is you not understanding how JavaScript works. Take a look at the **addRow** function in the comments section. It shows the concept of encapsulates the changes to a row inside a function. [https://ti-qa-archive.github.io/question/152853/html-tag-in-a-row] I add this to give you a push to solve your own problem, I am not going to give you tech support though. But in essence the idea is create a function to deal with a single instance of each row and return the result - then push that results into your array. You do NOT need to change all your code to match my example.
There's nothing wrong with JS code there, it's Titanium bug (if it hasn't dropped passing JS object as table view row, which I think it has not ... yet).
Hello [~core13] This is a titanium bug. This ticket was written by our Appcelerator QE intern Josh, and was evaluated by a Senior Quality Engineer and our Senior QE manager prior to submission (which is how we train our interns). Regardless of the code used, be it yours, the attached example, or a more simple manual creation of the tableview rows we get the same bad behavior. Perhaps you might consider more carefully the tone of your comments, because to me, your recent comment seems a bit demeaning. Here is another sample that shows the same behavior:
This is no 6.0.0 regression right? Moving it to 6.1.0 for now.
master: https://github.com/appcelerator/titanium_mobile/pull/8848
{noformat} Mac OS Version : 10.12.3 Appc CLI : 6.1.0 Appc NPM : 4.2.9-1 Node : v4.6.0 Device: Nexus 5x(6.0.1) Pixel XL(7.1.1) Emulator: (6.0), (4.4.2) {noformat} Using above env passed FR. After merge, the changes are present in SDK
6.1.0.v20170227120704
. *Closing*