UA-17470720-3

Jump to content


Photo
- - - - -

expand/collapse headers

view-controllers sections models

  • Please log in to reply
2 replies to this topic

#1 Tribee

Tribee

    Starting Out

  • STV Lite
  • Pip
  • 5 posts
Reputation: 0
Neutral

Posted 15 October 2013 - 11:49 AM

Hi, I am new to STV and currently checking out the STV Light framework.

 

Looking into the "Autosearch.app", I am trying to modify the PeopleViewController to behave like this:

 

- I would like the header sections in the PeopleviewController to be able to expand/collapse.

 

I cannot seem to be able to access the sections to add a expandCollapseCell to a  SCArrayOfObjectsModel because I cannot get a grip on the sections that underly the ArrayOfObjectsModel. I would expect this to be possible, so maybe I overlook something.

 

Why would I want this? Suppose I have a task list that I would like to view ordered by month, where specific months can be collpased/expanded: I would like one big list to be automatically subdivided in month (each with a header showing the month name), and a expand/collapse triangle so the user can collapse the large list to show only the month(s) he/she is interested in. However: all in *one* table.

 

Hope someone can point me in the right direction... (thanks in advance!)

 



#2 Aris Kox

Aris Kox

    Sr. Member

  • STV 5.0 Pro
  • PipPipPip
  • 35 posts
Reputation: 14
Good

Posted 17 October 2013 - 04:56 AM

use modelActions.didAddSection  to add the expandCollapse cell.

 

tableViewModel.modelActions.didAddSection = ^(SCTableViewModel *tableModel, SCTableViewSection *section, NSUInteger sectionIndex)

 

{

section.expandCollapseCell = [SCExpandCollapseCell cellWith..............];
};
 


  • David DelMonte and Tribee like this

#3 Tribee

Tribee

    Starting Out

  • STV Lite
  • Pip
  • 5 posts
Reputation: 0
Neutral

Posted 17 October 2013 - 05:26 AM

use modelActions.didAddSection  to add the expandCollapse cell.

 

tableViewModel.modelActions.didAddSection = ^(SCTableViewModel *tableModel, SCTableViewSection *section, NSUInteger sectionIndex)

 

{

section.expandCollapseCell = [SCExpandCollapseCell cellWith..............];
};
 

Aris,

 

Thanks for the pointer. This is perfect!

 

:-)







Also tagged with one or more of these keywords: view-controllers, sections, models

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users