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
-
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>
---) -
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>
---) -
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
- 1 yr agoLast active
- 8Replies
- 139Views
-
3
Following