techteej
Sep 28, 2014 - 06:59
For some reason, entering text into a Text Field then adding to a table splits up the word into one cell for each letter.
# coding: utf-8
import ui
class Data (ui.ListDataSource):
def __init__(self, items=None):
ui.ListDataSource.__init__(self, items)
def tableview_cell_for_row(self, tableview, section, row):
cell = ui.TableViewCell()
cell.text_label.text = str(self.items[row])
return cell
def add_new_item(sender):
tv1 = view['reminders']
tv1.data_source = Data(items=view['new_item'].text)
tv1.reload_data()
view = ui.load_view('reminders')
view.present('sheet')