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

Add a default value for a field in a table. #615

Open
sinaw369 opened this issue Apr 25, 2024 · 3 comments
Open

Add a default value for a field in a table. #615

sinaw369 opened this issue Apr 25, 2024 · 3 comments

Comments

@sinaw369
Copy link

I want to set a default value for a field in a table, but I don't know how to do it. I'm looking for a method similar to info.AddField("Limit", "limit", db.Int).FieldDefault(100), but it seems that this method is only used for typing the panel. Can you implement this method for the table?

@chenhg5
Copy link
Collaborator

chenhg5 commented Apr 26, 2024

Are you referring to specifying a default value for a field when submitting a form? If so, you can use this: formList.AddField("Limit", "limit", db.Integer, form. Number).FieldDefault("100"). Can you give more examples, and screenshots better?

@sinaw369
Copy link
Author

Are you referring to specifying a default value for a field when submitting a form? If so, you can use this: formList.AddField("Limit", "limit", db.Integer, form. Number).FieldDefault("100"). Can you give more examples, and screenshots better?

Thanks for your response. I would like to create an example similar to this example, but with the default city field as "ABC".
image

@sinaw369
Copy link
Author

@chenhg5

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

2 participants