Show properties from a selected option

Thread is closed for posting
4 posts, 1 answers
  1. Jesús
    Jesús avatar
    7 posts
    Member since:
    Feb 2013

    Posted 21 Dec 2016 Link to this post

    Hello! I think that this is easy to achieve, but i cannot find the way. So here's the question: I have a main view that contains a editor which shows a list of 10 options. When i select a option the navigation returns to main view and, depending on the option selected want to show a group of properties of that option. The problem is that i cannot find a way to hide or show the group when i return to the main view. I've tried with the updateEditor Delegate Method, but at least just can hide the group of my dataSource. ([[self.dataSource.groups objectAtIndex:0]setHidden:YES]) Hope that anyone can help me. Greetings.
  2. Answer
    Adrian
    Admin
    Adrian avatar
    174 posts

    Posted 23 Dec 2016 Link to this post

    Hello Jesus,

    Thank you for contacting us.

    You can achieve this by implementing TKDataFormDelegate's dataForm:didEditProperty: method where you should set the hidden property of the group like in the code from your post. However this will mark the group as hidden in the TKDataFormEntityDataSource, so you should also call the data form's reloadData method. This will make the data form request the updated information from the data source. You should call reload data when the view with the data form is ready to be shown on screen. A possible place is viewWillAppear. Consider the code below:
    - (void)viewWillAppear:(BOOL)animated {
        if (_shouldReloadData) {
            _shouldReloadData = NO;
            [self.dataForm reloadData];
        }
    }
     
    - (void)dataForm:(TKDataForm *)dataForm didEditProperty:(TKEntityProperty *)property {
        if ([property.name isEqualToString:@"encryptionLevel"]) {
            [_dataSource groupAtIndex:0].hidden = YES;
            _shouldReloadData = YES;
        }
    }

    I hope this helps.

    Regards,
    Adrian
    Telerik by Progress
    Want to build beautiful Android apps as well? Check out UI for Android which enables the same set of scenarios, allowing you to create the same great app experience on both iOS and Android.
  3. Jesús
    Jesús avatar
    7 posts
    Member since:
    Feb 2013

    Posted 23 Dec 2016 in reply to Adrian Link to this post

    This works like a charm! Thanks Adrian, thanks a lot :)
  4. Adrian
    Admin
    Adrian avatar
    174 posts

    Posted 27 Dec 2016 Link to this post

    Hi,

    I am glad that I could help. Since the issue is solved I'm closing this thread. If you need further assistance do not hesitate to contact us again.

    Regards,
    Adrian
    Telerik by Progress
    Want to build beautiful Android apps as well? Check out UI for Android which enables the same set of scenarios, allowing you to create the same great app experience on both iOS and Android.
Back to Top