Skip to content

Commit

Permalink
Merge branch 'master' into hh-vue3
Browse files Browse the repository at this point in the history
  • Loading branch information
hhaensel committed Apr 18, 2024
2 parents cf90c83 + 2b8b7d8 commit 90059f6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ext/StippleUIDataFramesExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ end

function Stipple.convertvalue(target::Stipple.R{<:DataTable{DataFrames.DataFrame}}, d::AbstractDict)
df = Stipple.stipple_parse(DataFrames.DataFrame, d[StippleUI.Tables.DATAKEY])
oldnames = names(df)
newnames = getindex.(d["columns"], "name")
# the following line guarantees that the order of the columns is preserved
newnames = intersect(union(oldnames, newnames), newnames)
oldnames = names(target.data)
newnames = names(df)
idcolumns = ["__id"]
target.opts.addid && push!(idcolumns, target.opts.idcolumn)
# preserve order of the columns and remove automatically added idcolumns
newnames = setdiff(intersect(union(oldnames, newnames), newnames), idcolumns)
DataTable(df[:, newnames], target.opts)
end

Expand Down

0 comments on commit 90059f6

Please sign in to comment.