I have developing the titanium tableview. here if i have select any row , need to pass the row values from one window to next window.
But From my code .,
Am getting the list of table rows successfully. the row data also passed.
But i have facing a problem ., First time am clicking one row means the null value is passed . After that come back the list view and click another row means the previous selected row id is passed to next window .why i have facing this issue ? what's problem here ? Please give me a solution .
I have using below code :
dataArray = [];
for(var i=0; i<json.length; i++){
var row = Ti.UI.createTableViewRow({
className: 'row',
objName: 'row',
folder_id:json[i].folder_id,
layout : 'horizontal',
touchEnabled: true,
width: "100%",
height: Ti.UI.SIZE,
});
row.add(Ti.UI.createLabel({
text: json[i].folder_id,
title: json[i].folder_id,
left: 10,
top: 5,
width: 0,
visible : false,
font: { fontSize: '18dp' },
color: '#040404',
wordWrap: true,
height: Ti.UI.SIZE,
ellipsize: true
}));
row.add(Ti.UI.createLabel({
text: json[i].folder_name,
title: json[i].folder_name,
left: 10,
top: 5,
width: 100,
font: { fontSize: '18dp' },
color: '#040404',
wordWrap: true,
height: Ti.UI.SIZE,
ellipsize: true
}));
dataArray.push(row);
};
$.FoldertableView.setData(dataArray);
$.FoldertableView.addEventListener('click', function(e){
Ti.API.info("folder_id"+ e.rowData.folder_id );
var managereditfolder =Alloy.createController('editfolder').getView();
Ti.App.Properties.setString("folder_id", e.rowData.folder_id);
managereditfolder.open();
});
editfolder.js
folder_id = Ti.App.Properties.getString("folder_id");
Ti.API.info("Edit Folder folder_id"+ folder_id );
here am getting the output like :
folder_id 14 [WARN] : Invalid value auto specified for property top [INFO] : Edit Folder folder_id null
folder_id 5 [WARN] : Invalid value auto specified for property top [INFO] : Edit Folder folder_id 14
Please check my code and give me a solutions