Genie Discord forum

Author Avatarkorilium revilius
2/19/2023, 10:56:10 PM

Currently, I am following the MVC Web tutorial in the Genie documentation and in the section 'Adding the search feature' I want to change the following:

<% if ! isempty(movies) for_each(movies) do movie partial(joinpath(Genie.config.path_resources, "movies", "views", "_movie.jl.html"), movie = movie) end else partial(joinpath(Genie.config.path_resources, "movies", "views", "_no_results.jl.html")) end %>

into code that does not call a file 100 times but instead only once and it should give me a dataframe instead of loose rows. So my main question is:

How do you render a Dataframe in Genie?

I have tried using the HTML and render function of Genie.Render.HTML, but I cannot seem to work it out.
Already big thanks in advance!

Author Avataressenciary
2/20/2023, 8:27:18 AM

how would you like to render the dataframe? as a static table? or as something as a data table with sorting, filtering, pagination, etc?

Author Avatarkorilium revilius
2/20/2023, 2:24:08 PM

A data table would be great!

Author Avatarhhaensel
3/7/2023, 11:53:39 PM

Well then use a DataTable from StippleUI

model.datatable[] = DataTable(df)
ui() = <...code...> table(:datatable) <... more code ...>