Copied to clipboard

Flag this post as spam?

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


  • Matt 353 posts 825 karma points
    Jul 06, 2018 @ 09:44
    Matt
    0

    Hello all,

    Hope we're all looking forward to the weekend!

    I have a question and hope someone can point me in the right direction.

    I'm using fluidity to deal with my form submisions and have got everything working nicely so far, However I'm looking at adding an Action field which I've setup as a text box using the following;

    tabConfig.AddField(p => p.Action);
    

    However when they go to edit, its a text box and they have to type in the action manually e.g Responded, No further action, Waiting reply

    What I'm looking to do is have a drop down box which has a list of actions they can quickly use.

    Could someone point me in the right direction how I could do this?

    Thanks in advance,

    Matt

  • Matt 353 posts 825 karma points
    Jul 09, 2018 @ 06:46
    Matt
    0

    Hello,

    Anyone able to help with this?

    Thanks Matt

  • Anthony Chudley 50 posts 197 karma points
    Jul 09, 2018 @ 08:25
    Anthony Chudley
    0

    If you have a data type set up in the back office you can select that either by name or by id.

    So if your action responses were set up in a Data Type called "Action dropdown"

    tabConfig.AddField(f => f.Action).SetDataType("Action dropdown");
    

    Should set that data type as the editor for that field.

    Full details can be seen in the awesome docs

    Hope that helps.

  • Matt 353 posts 825 karma points
    Jul 09, 2018 @ 08:58
    Matt
    0

    Hello Anthony,

    Thanks I did try that but didn't seem to do anything when I tried before, I did notice the only thing different is;

    (f => f.Action)

    (p => p.Action)

    Whats the difference in using F or P? using F works fine so thanks :)

    However, it doesn't seem to be working as it should. I get a drop down box and it shows all my values. but when I select a value in drop down and save it. the change converts to a number rather then the text?

    Thank you.

  • Anthony Chudley 50 posts 197 karma points
    Jul 09, 2018 @ 11:33
    Anthony Chudley
    0

    No real difference, I just copied the example from my Fluidity config on my site where I used 'f'. I would make sure it matches throughout your code for consistency. So if you use 'p' elsewhere, stick with it.

    The dropdown picker saves the index of the item selected if I remember right. So it should be able to pick up and display the selected value still in the back office still.

    This would be a bit different if you then needed to render it in a view, as you couldn't use the built-in property value converter. I think there is a way to get the selected value from the index but off the top of my head I can't remember where I found the docs on it.

    The other solution could possibly be value mappers. Although I haven't used them myself yet.

Please Sign in or register to post replies

Write your reply to:

Draft