Rank: Newbie
Groups: Registered
Joined: 4/9/2021(UTC) Posts: 8 Location: Rotterdam Thanks: 2 times
|
Hi, I started recently building an order app with MT, but I can't get the image view correctly. In my test SQLite DB I have 7 images stored, all 150x150 px and I would like to plot these in my app 2 images on a row and dynamically have multiple rows, depending on the number of products/images. Eventually I'd like to have 2 x 8 pictures visible on the screen and the rest accessible via a slider. I tried to create a 1 x 1 table with repeating rows but then all pictures are positioned vertically. Using repeating columns results in attached view. Using both repeating rows and columns gives the same result as only repeating rows. Looking at the documentation using both repeating rows and columns works more like a pivottable? Maybe I missed a function or setting, but any help would be appreciated Edit: Added DB File Attachment(s): Arjen attached the following image(s):
|
|
|
|
Rank: Administration
Groups: Registered, Administrators Joined: 7/21/2014(UTC) Posts: 498
Was thanked: 88 time(s) in 88 post(s)
|
Your guess was correct - using repeating row/column combination is what you should do. If you attach here your SQLite database, I will return back with the ready-to-use design file
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 4/9/2021(UTC) Posts: 8 Location: Rotterdam Thanks: 2 times
|
DB added in original post
|
|
|
|
Rank: Administration
Groups: Registered, Administrators Joined: 7/21/2014(UTC) Posts: 498
Was thanked: 88 time(s) in 88 post(s)
|
Here is the design file. I defined a global variable $ColNr to make it more flexible for you to decide how many columns to show
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 4/9/2021(UTC) Posts: 8 Location: Rotterdam Thanks: 2 times
|
Originally Posted by: bbv Here is the design file. I defined a global variable $ColNr to make it more flexible for you to decide how many columns to show Thanks, looks great! I altered one of the statements a bit as it showed only a even number of images. Without the "-1" it shows all images, even when there are odd number of images in the DB 0 to ( count( $DB1/DB/RowSet/Row ) idiv $ColNr ) --> removed "-1" Thanks again!
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 4/9/2021(UTC) Posts: 8 Location: Rotterdam Thanks: 2 times
|
One more question. Does this solution has any effect on assigning the record_ID of an image to a global element? I created a update node that should hold the image_ID of the image I click on, but instead of getting 1 ID in return I get all values (1 - 11). I checked the book tutorial and followed all steps but it behaves differently. File Attachment(s): Arjen attached the following image(s):
|
|
|
|
Rank: Administration
Groups: Registered, Administrators Joined: 7/21/2014(UTC) Posts: 498
Was thanked: 88 time(s) in 88 post(s)
|
No - the issue is because of an error in your statement - your XPath selects all ids. You need to select the current node instead. I've attached here a modified solution which will put an id on image click. I've created a function TableNode to avoid rewriting the same code, and I'm using it to select the proper node for image and for product id
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 4/9/2021(UTC) Posts: 8 Location: Rotterdam Thanks: 2 times
|
Originally Posted by: bbv No - the issue is because of an error in your statement - your XPath selects all ids. You need to select the current node instead. I've attached here a modified solution which will put an id on image click. I've created a function TableNode to avoid rewriting the same code, and I'm using it to select the proper node for image and for product id Works great again, thanks for your help!
|
|
|
|
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.