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

Edit or Enter with select box #1

Open
samiit opened this issue Mar 17, 2021 · 6 comments
Open

Edit or Enter with select box #1

samiit opened this issue Mar 17, 2021 · 6 comments

Comments

@samiit
Copy link

samiit commented Mar 17, 2021

Hi @luk-f-a , do you have any suggestion how we can make one of the entries, when clicking "New Item" or "Edit" as a selection from a list?

Thanks,
Sam

@luk-f-a
Copy link
Owner

luk-f-a commented Mar 17, 2021

hi @samiit , I can push an example today or tomorrow but as a quick answer, these are the steps:

  • instead of <v-text-field> use <v-select :items="select_items" v-model="selected_value" label="select something">
  • on the python side, you need to make sure that select_items and selected_value are declared as traitlets on the python class. select_items should be a traitlets.List with the options, and selected_value a traitlets.Unicode.

@samiit
Copy link
Author

samiit commented Mar 17, 2021

Thanks for the quick answer @luk-f-a . I appreciate the quick pointers. I will see if I can get it working.

Since I am new to ipyvuetify and don't know JS, I would be glad if you could include in your proposed example, a specific case when some columns have a dropdown, some checkbox (True/False) while others have numerical or string entries.

Thanks in advance.
Sam

@luk-f-a
Copy link
Owner

luk-f-a commented Mar 17, 2021

you will be surprised how much you can get done as a beginner. I first spent about 2-4 hours banging my head, unable to get anything working (that's when I posted to the ipyvuetify issue). But after looking at several examples, I understood the logic of the vuetify templates and it became very easy after that. When I built this repo I had been working with ipyvuetify for about 6-8 hours, and I had never done any html or javascript before. It's surprinsingly accesible! the key is that the vuetify documentation has many examples that you can use to learn. I also recommend reading this: https://vuejs.org/v2/guide/syntax.html

@samiit
Copy link
Author

samiit commented Mar 19, 2021

Hi @luk-f-a

I am sorry that I am loading you with many requests.
Could you please consider to include in your example an option to update the data table with new values read from an imported csv file? I am struggling to get it working under Voila.

Thanks and waiting for your example.
Sam

@luk-f-a
Copy link
Owner

luk-f-a commented Mar 19, 2021

hi @samiit , sorry, it's very specific use case that does not really belong here. But if you put your code in a github gist and tell what didn't work for you, I can have a look and give you some feedback.

@samiit
Copy link
Author

samiit commented Mar 19, 2021

Sure @luk-f-a . I will do that. Thank you for pushing me to be orderly and asking pointed questions. Thanks for the readiness. I will get back soon.

Sam

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