Genie Discord forum

Author AvatarMahnoorFatima - Pakistan
8/8/2023, 12:05:04 PM

I want to display a DataFrames.DataTable object in HTML with pagination view. How can I accomplish it with the quasar framework? (I'm unable to get the q-table div to work.) TIA

Author AvatarPere
8/11/2023, 9:36:04 AM

We have several examples on displaying data tables in apps with a reactive UI. For instance, the Iris Clustering demo

Author AvatarPere
8/11/2023, 9:36:36 AM

If your use case does not fit these examples, please provide a MWE and I'll help you out

Author AvatarMahnoorFatima - Pakistan
8/13/2023, 11:09:04 AM

Thanks, I got the DataTable working. However, there's another issue I'm trying to work through.

I’m trying to create a Genie application in which the plots and DataTable will change with the change in the dataset. I’m unable to figure out how to make the dataset generic so that it can be used by all the @out variables. A sample code snippet is as follows:

@app begin
        @out pca_data::R{DataTables.DataTable} = dataset("datasets", "iris") |> DataTables.DataTable
        @out data_pagination = StippleUI.Tables.DataTablePagination(rows_per_page=15) 


@onchange dataset_name begin
            if dataset_name == "Iris"
                pca_data = dataset("datasets", "iris") |> DataTables.DataTable
            elseif dataset_name == "Motor Trend Car Road Tests"
                pca_data = dataset("datasets", "mtcars") |> DataTables.DataTable
                pca_data = dataset("datasets", "Titanic") |> DataTables.DataTable

I’d like to replace the dataset("datasets", <dataset_name>) with a reactive element. Is there another way to go about it than the reactive model as done in the IrisClustering example?

Author AvatarPere
8/16/2023, 8:08:32 AM

What is exactly the problem? Is the selector dataset_name not working, or the table not updating?

I think you might be using the wrong type for the table. The type of the data table is GenieFramework.DataTable, or just DataTable as it is already exported when using GenieFramework.