Trying to dynamically load buttons based on datatables

Datatables are working fine, I can see all the data being generated from the struct. It’s a simple Name, Category and Icon struct.

I have a button with an image widget that I’ve added to another widget that has a uniform grid box in it. In the graph of this grid box widget I have this. As of right now it only generates on button with an image from the data table. I’m stuck as to how to generate more as it appears to me that my script should in theory work.

Any clues? I’ve been at it all day reading forum posts and youtube tuts and I still think I’m searching around in the dark

Moving the Add Child Node to after the Set Brush node and changing the uniform grid panel into a vertical box or a horizontal box spawns all the buttons with a grey texture

Try this:

Since you are working with an editor widget, you should use CondtructObjectFromClass instead of CreateWidget. Also, you add a child to the panel after the loop is executed, which means it only happens once with the last element of the array.

My Products

1 Like

Awesome that works! Thanks a lot.

Is there documentation out there on why to use ConstructObjectFromClass?

I plugged my array index into the Row and Col integers on the Add Child node as a test and they all spawn vertically, now I just need to find a way to generate a certain number of columns per row

I figured out how to format the widget properly. I used a wrap box

In my data table there is column for categories. How would I go about sorting the for each loop and on different categories adds it to a different wrap box that I have?

1 Like

Amazing. Thank you very much, it worked flawlessly. I owe you a pint or a KoFi!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.