UA-17470720-3

Jump to content


Photo
- - - - -

Finer grain on Require Edit mode


  • Please log in to reply
4 replies to this topic

#1 David DelMonte

David DelMonte

    Forum Master

  • STV 4.0 Pro
  • PipPipPipPipPipPipPip
  • 527 posts
Reputation: 41
Excellent

Posted 07 January 2015 - 02:33 PM

As an example,(using the sample Task App).

 

1. Enter some Task info and save.

2. Enter some TaskStep info and save.

3. Switch on the "Require Editing mode to Edit" button.

 

Now I cannot see the Task Steps without editing. It would be great if we could at least see these.


 


  • Adjuramum likes this

#2 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 08 January 2015 - 08:53 AM

Hi David,

 

The idea is that once you're able to access the task steps, you'll be able to edit them even though the parent is not in edit mode, and thus violating the require editing mode to edit requirement. You can still override this if you wish by setting the taskSteps cell to 'enabled':

 

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    SCClassDefinition *taskDef = (SCClassDefinition *)[self dataDefinitionWithIBName:@"Task"];
    SCPropertyDefinition *taskStepsPDef = [taskDef propertyDefinitionWithName:@"taskSteps"];
    taskStepsPDef.cellActions.willDisplay = ^(SCTableViewCell *cell, NSIndexPath *indexPath)
    {
        cell.enabled = YES;
    };
}

  • David DelMonte likes this

#3 David DelMonte

David DelMonte

    Forum Master

  • STV 4.0 Pro
  • PipPipPipPipPipPipPip
  • 527 posts
Reputation: 41
Excellent

Posted 08 January 2015 - 11:54 AM

Thanks Tarek. I've been playing around, and I find that the Assigned Task is my real objective.

 

I have this:

 

 

SCClassDefinition *personClass = (SCClassDefinition *)[self dataDefinitionWithIBName:@"TaskEntity"];
SCPropertyDefinition *personDef = [personClass propertyDefinitionWithName:@"assignedTo"];
personDef.cellActions.willDisplay = ^(SCTableViewCell *cell, NSIndexPath *indexPath)
{
cell.enabled = YES;
}; 
 

 

But the selections are not saved.. What am I doing wrong?



#4 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 08 January 2015 - 12:38 PM

To start with, I don't think "TaskEntity" is of type SCClassDefinition, but that's a different issue :) 

 

Is the line cell.enabled = YES being called at all if you place a breakpoint there? Make sure that personDef actually has a value.



#5 David DelMonte

David DelMonte

    Forum Master

  • STV 4.0 Pro
  • PipPipPipPipPipPipPip
  • 527 posts
Reputation: 41
Excellent

Posted 08 January 2015 - 12:44 PM

I just came here to delete that post. You beat me .. I'm all set on this.. Thanks!!






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users