0

Image in form keeps jumping left

Hi,

Is there a solution for an image (derived from an attachment) jumping to the left in a form? I've tried the html function but that doesn't work: I get a question mark displayed and not the file's image. Since every record has its own individual file (an invoice) I've tried coding the filename but I seem to get stuck .

This is how far I got:

let a := file(this, text("Factuur " + Nr + "-" + Sessie + ".pdf"));
let i := Id;
let b := text("/Users/username/Library/Containers/Ninox Database/Data/Documents/data/Administratie/files/M/");
let c := text(b + i + "/" + a);
html("<img src=""c"">")

But that displays the question mark in the function I placed on the right side of the form.

Just the file(this, text("Factuur " + Nr + "-" + Sessie + ".pdf") function works fine and displays the attachment in the form but ... it keeps placing itself on the left side.

 

Marjolijn

1 reply

null
    • Mel_Charles
    • 2 days ago
    • Reported - view

    @Marjolijn

    By definition all images go to the left on the form - one day ninox will do something about this.

    I assume you want to move/keep the image to the centre /right of other fields on the form.

    If so put the text info into a formula field somewhere at the bottom of your form. you can set that formula to be same as background to make in invisible. save exit and go back in.

    see image

    Note :  you can control up to 5 items on theform page

    in my example screenshot the image it kept over to the right of other fields 

    I have highlighted that part

     

    var params := {
            id: "myUniquID",
            fields: [{
                    name: "Ordered Address",
                    align: "left"
                }, {
                    name: "Delivery Address",
                    align: "left"
                }, {
                    name: "JobDetail",
                    align: "left"
                }, {
                    name: "118Print Notes",
                    align: "left"
                }, {
                    name: "P/O Conf",
                    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>
    ---)

     

    This is not my solution but was i think first provided by  this was ages ago and i use it extensively

Content aside

  • 2 days agoLast active
  • 1Replies
  • 25Views
  • 2 Following