0

Stack fields next to Multiline Text?

Is there really no way to stack up fields next to a tall multiline text field?

I would really like to stack the Email and two Phone fields. I can stack them next to an Image field, but I can't seem to do it next to this multiline Text field.

8 replies

null
    • Ninox developper
    • Jacques_TUR
    • 1 yr ago
    • Reported - view

    Yes, is possible with html function. See here and here

      • Kent_Signorini
      • 1 yr ago
      • Reported - view

      Jacques TUR 

      Whoo hooo! Thanks!

      • Kent_Signorini
      • 1 yr ago
      • Reported - view

      Jacques TUR Just one more big thank you for this. You can even stick other fields between left aligned ones and right aligned ones and they seem to behave properly.

      Awesome.

      • Kent_Signorini
      • 1 yr ago
      • Reported - view

      Jacques TUR 

      It seems that if I use right for 3rd multiple choice and space next to it, and left for the other three elements, it aligns the multiple choice fields up at the top! This is also fantastic!
       

      • Ninox developper
      • Jacques_TUR
      • 1 yr ago
      • Reported - view

      Kent Signorini good job ! 👍

    • Mel_Charles
    • 8 mths ago
    • Reported - view

    Jacques

    Do you know if this code got broken with subsequent Ninox updates.

    I have revisited a project that had this in and that was working but this is no longer working for me now.

    var options1 := {
            fieldName: "Address",
            align: "left"
        };
    html(---
    <script>
    ui.getCurrentEditor().currentTab.components.find( e => e.field.caption == '{ options1.fieldName }' ).el[0].style.float='{ options1.align }';
    </script>
    ---)

    • Mel_Charles
    • 8 mths ago
    • Reported - view

    Ah it's okay

    I see you did further mods after i parked my project

    uploaded your later code as below and all is well 

    var params := {
            id: "myUniquID",
            fields: [{
                    name: "Address",
                    align: "left"
                }, {
                    name: "Role",
                    align: "right"
                }, {
                    name: "Email",
                    align: "right"
                }, {
                    name: "Phone",
                    align: "right"
                }, {
                    name: "Name",
                    align: "right"
                }]
        };
    html(---
    <script id='{ params.id }'>
    var components = $(document.querySelectorAll('#{ params.id }')).last().closest('.component').data('component').container.currentTab.components;{ formatJSON(params.fields) }.forEach( f => components.find( e => e.field.caption == f.name ).el[0].style.float=f.align)
    </script>
    ---)

    • Mel_Charles
    • 8 mths ago
    • Reported - view

    So for the benefit of newbies to this forum. What Jaques code above does is - turn this layout below 

    Into this

    As you can see the fields on the right are now stacked above each other next to the large address box and this gets around the fact that you can't do this as standard within Ninox when placed next to a large data box/image !

    Just put the code into a formula field. you can make that filed invisible by changing the style colour to the same as the form background. Change the field names to match your fields!.

    see Jacques other links for full thread information here. See here and here

    a truly great solution by Jacques !

Content aside

  • 8 mths agoLast active
  • 8Replies
  • 123Views
  • 3 Following