Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Evan 40 posts 59 karma points
    Dec 22, 2010 @ 07:53
    Evan
    0

    Custom DataType/DataEditor Question

    So I've watched the videos at Umbraco TV regarding custom Data Types/Data Editors here:

    http://umbraco.tv/help-and-support/video-tutorials/developing-with-umbraco/data-editors/adding-settings-to-your-data-editor

    And I have successfully created a new data editor with a prevalue setting as well.

    Now I would like to allow the user to add several "prevalue" values, exactly the same way that a Dropdown list does. Essentially a list of prevalues that can be easily added or deleted by a developer.

    IE.

    1) User Create a new datatype:
    2) User clicks Save
    3) User adds prevalue clicks save
    4) User does the same and can now see both values with the "delete" link next to it.

    I can't see how this would be set up in the code. I've looked throug the DB and can't work it out there either.

    Any ideas would be excellent!

    Thanks!

    Evan

  • Comment author was deleted

    Dec 22, 2010 @ 09:04

    Hi Evan,

    Is that the only config option you need ? Then you can just use a default prevalue provider, take a look at the sourcecode for the dropdown datatype and you'll see how you need to use it

  • Evan 40 posts 59 karma points
    Dec 23, 2010 @ 00:09
    Evan
    0

    Ah cool, but where can I find the source coode for this?

  • Comment author was deleted

    Dec 23, 2010 @ 08:52
  • Comment author was deleted

    Dec 23, 2010 @ 08:52

    Basicly it's this part:

     

    public override interfaces.IDataPrevalue PrevalueEditor 
    {
    get
    {
    if (_prevalueeditor == null)
    _prevalueeditor = new KeyValuePrevalueEditor(this);
    return _prevalueeditor;
    }
    }
Please Sign in or register to post replies

Write your reply to:

Draft