Friday, May 26, 2017

#1 2016-08-30 11:41:43 am

Jonathan Engelhardt
Member
Registered: 2010-06-11
Posts: 57

Custom CellView with button -> link problem

I have a view based table with one column and a customCellView with labels and a button.
The button click adresses a function inside the customCellView class.

How can i get access to the array controller from within the customCellView that manages the tableView entries?

- OR -

How can i BIND the click to a method of my choice? Is this possible at all?
Does the method need to be inside the customCellView class?

Last edited by Jonathan Engelhardt (2016-08-30 11:42:50 am)

Offline

 

#2 2016-08-30 02:25:27 pm

Jonathan Engelhardt
Member
Registered: 2010-06-11
Posts: 57

Re: Custom CellView with button -> link problem

Got it... well.

In custom cell class

Applescript:


My superview()'s superview()'s dataSource()-- tableView's array controller

Last edited by Jonathan Engelhardt (2016-08-30 02:26:27 pm)

Offline

 

#3 2016-08-30 02:35:00 pm

StefanK
Member
From: St. Gallen, Switzerland
Registered: 2006-10-21
Posts: 11442
Website

Re: Custom CellView with button -> link problem

According to the MVC (model-view-controller) pattern you are discouraged from manipulating the view (the cell).

Change the model (the data source) and reload the table view


regards

Stefan

Offline

 

#4 2016-08-30 02:40:53 pm

Jonathan Engelhardt
Member
Registered: 2010-06-11
Posts: 57

Re: Custom CellView with button -> link problem

The complete setup is made with bindings.
The array controller is a custom class used for dragging rows - to maintain the bindings and update the view it's connected as datasource and to the table in addition.

Please give some more advice in detail (help me understand)

EDIT: I used a notification/observer now to trigger the method

Last edited by Jonathan Engelhardt (2016-08-31 02:15:09 pm)

Offline

 

Board footer

Powered by FluxBB

[ Generated in 0.104 seconds, 11 queries executed ]

RSS (new topics) RSS (active topics)