TKDataFormOptionsEditor

4 posts, 0 answers
  1. Ryan
    Ryan avatar
    25 posts
    Member since:
    Jun 2016

    Posted 13 Jun Link to this post

    My view controller inherits from TKDataFormViewController and I set the editor for my field like so:

    _dataSource[@"name"].editorClass = [TKDataFormOptionsEditor class];

     

    However it only displays one option and whenever I click on the cell it does not take me to another screen to make a selection. How can I get TKDataFormOptionsEditor working?

  2. Ryan
    Ryan avatar
    25 posts
    Member since:
    Jun 2016

    Posted 13 Jun in reply to Ryan Link to this post

    Never mind I figured that one out. I was using my own TKDataForm instead of the one for the inherited one from the view controller. Now I have run into another issue. How can I set the valuesProvider after viewDidLoad?
  3. DevCraft banner
  4. Ryan
    Ryan avatar
    25 posts
    Member since:
    Jun 2016

    Posted 13 Jun in reply to Ryan Link to this post

    Figured it out. It was the exact same thing as the above that was an issue. Is there a delegate method that will allow me to detect when the user selects one of the options from the second screen?
  5. Sophi
    Admin
    Sophi avatar
    99 posts

    Posted 15 Jun Link to this post

    Hi Ryan,

    There is no specific callback for selection out of the options menu. However you can use the didCommitProperty method of the TKDataFormDelegate. It is triggered every time a property has been committed to the object model meaning it will be triggered when you choose option from the TKDataFormOptionsEditor. Consider the code below.
    - (void)dataForm:(TKDataForm *)dataForm didCommitProperty:(TKEntityProperty *)property{
        if ([property.name  isEqual: @"section"]){
           // perform logic when item of the options menu is selected
        }
    }


    Regards,
    Sophi
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
DevCraft banner