Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Single Select fields doesn't show value in Details screen #651

Open
mohamad-abuzaid opened this issue Jan 31, 2025 · 0 comments

Comments

@mohamad-abuzaid
Copy link

Hello all, I have this "users" table.
The list shows fine table view..
But when I navigate to Item details screen, the Dropdown fields appear empty. Although they have data.

Here is my current code..


users.go

`func GetUsersTable(ctx *context.Context) table.Table {
users := table.NewDefaultTable(ctx, table.DefaultConfigWithDriver("mysql"))

info := users.GetInfo().HideFilterArea()

info.AddField("ID", "id", db.Int).FieldSortable()
info.AddField("Username", "username", db.Varchar).FieldSortable()
info.AddField("Gender", "gender", db.Varchar).
	FieldJoin(types.Join{
		BaseTable: "app_users",
		Field:     "gender_id",
		Table:     "app_genders",
		JoinField: "id",
	})
info.AddField("Points", "points", db.Int).FieldSortable()
info.AddField("Rank", "rank", db.Varchar).
	FieldJoin(types.Join{
		BaseTable: "app_users",
		Field:     "rank_id",
		Table:     "app_ranks",
		JoinField: "id",
	})
info.AddField("Language", "language", db.Varchar).
	FieldJoin(types.Join{
		BaseTable: "app_users",
		Field:     "lang_id",
		Table:     "app_languages",
		JoinField: "id",
	})

info.SetTable("app_users").
	SetTitle("Users").
	SetDescription("Users")

details := users.GetDetail()
details.SetTable("app_users").
	SetTitle("User Details").
	SetDescription("User Details")

....

return users
 }`

Correct View in table list

Image


Error View in Details screen

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant