Foren

Ability to refresh Cell in BaseListScreenlet

thumbnail
Salva Tejero, geändert vor 7 Jahren.

Ability to refresh Cell in BaseListScreenlet

Junior Member Beiträge: 77 Beitrittsdatum: 13.06.11 Neueste Beiträge
Hello

When I fire the method of the BaseListScreenletDelegate " func screenlet(screenlet: CustomListScreenlet, onCustomSelected customElement: Custom) {", I need the row indexPath to refresh some ui component. Then I execute the method "(screenlet.baseListView as! CustomListView_default).tableView?.indexPathForSelectedRow" and the result always is null. I have severals sections in my BaseListScreenlet

Any idea?
thumbnail
Victor Galan, geändert vor 7 Jahren.

RE: Ability to refresh Cell in BaseListScreenlet

Regular Member Beiträge: 144 Beitrittsdatum: 14.06.16 Neueste Beiträge
if you see this code in the BaseListTableView class:



public func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
		tableView.deselectRowAtIndexPath(indexPath, animated: false)

		if let row:AnyObject = rows[indexPath.row] {
			onSelectedRowClosure?(row)
		}
	}


You can see we deselect the row after select it, this is why indexPathForSelectedRow is returning null,

A solution will be override that method and refresh the ui there or simply avoid calling deselectRow there

I hope it helps emoticon
thumbnail
Salva Tejero, geändert vor 7 Jahren.

RE: Ability to refresh Cell in BaseListScreenlet

Junior Member Beiträge: 77 Beitrittsdatum: 13.06.11 Neueste Beiträge
thank you very much.

Is there any possibility to change this method and deselect the row after call delegate method in the next release?
thumbnail
Jose M. Navarro, geändert vor 7 Jahren.

RE: Ability to refresh Cell in BaseListScreenlet

Regular Member Beiträge: 138 Beitrittsdatum: 24.01.14 Neueste Beiträge
Salva Tejero:
thank you very much.

Is there any possibility to change this method and deselect the row after call delegate method in the next release?


Yes, we'll release that change in the next minor version

Thanks!