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
Events - uAdmin based application #45
Comments
Good day! Two errors are found in kit.go: Now test your application to see if it will work. |
It' perfect! You are the best! @Spotlight64 |
My pleasure. |
Yes, it is possible. Inside the static folder, create a folder named js and inside it, create a Javascript file (e.g. "form.js") with the following codes below:
In your main.go, use IncludeFormJS method to apply the changes in the form. Now the value of the Sum will automatically recompute in the form once you change either the Number or Cost value in real time.
And in the menu.go, you can solve it after you save the record by implementing some calculation inside the Save function.
You can check this page for more examples on manipulating ModelSchema: https://uadmin-docs.readthedocs.io/en/latest/api/modelschema.html#uadmin-modelschema |
You are welcome. Regarding the error, it's a minor issue from the source code in fact that nothing affects in the user side. Nonetheless, we will fix that error as soon as possible. Thanks for reporting. |
Well noted, thanks |
Hello! Have a great day @Spotlight64 I've noticed that when I change my js files they are getting cashed - when I restart uAdmin in Visual Studio Code and restart my browser I'm getting previous version of js script. Have you noticed it? How do you solve it? I'm going to change columns of this table to fit my data and I'm going to make an Ajax request when the event is getting saved to make records in menu model. I'm also going to make an Ajax request when I open the event model to load previously made records with this table. I'm not sure if there is a way to load the table with data at same time when I load the model. I will be very grateful for any tips and advices. Here is my "/static/js/eventForm.js" file.
|
@MarErm27 I am not sure why saving crashes on your side. Javascript files are used to change something in the form and list which I find it working but if you want to update the records in your custom table that links to your Menu table inline, you need to do it in Go. @alphakitchown Somehow you have a way to this one? |
@dxlvgcw I clean cache for localhost:8080 in browser settings. It is works. But this is not a best way because I will have to clean cache on each computer after each update of JS file. |
from my research, i saw three functions in uadmin that automatically clears cache when you update something. its not those ones that solve javascript issue unfortunately |
We can request a feature for Javascript file support. |
@dxlvgcw I'm trying to impement a table in model Events which is a parent of model Menu. I want to load all records of model Menu where parent of each model is Event and put it to the custom table made by JavaScirpt on the page of Event model. The table is editable and when changes are done I need to record all changes to Menu model. I hope this will explain better what I'm trying to do, sorry for my english |
Okey I get what you mean. I will solve that one as much as I can. |
@alphakitchown Hello! This is really difficult for me. Can you help me solve this problem? |
@dxlvgcw i find it very challenging too. playing around with uadmin forms from what i know is beyond my knowledge already. just want to give you a hype, one of uadmin developers share a sneak peek of upcoming read the docs |
Really? Then this is good news!!! |
Hello! I'm trying to fetch all Menu model records with specified EventId where EventId is a field of model Event with this code:
I got error "no such column: EventID " Menu model struct
Event model struct
How to fetch all Menu model records with specified EventId? |
Good day! Use uadmin.Filter to fetch all records. Replace EventID to event_id, so it will be like this: |
@Spotlight64 Thank you so much! |
Hello!
I do AJAX GET request here.
It is goes to http://localhost:8080/api/table and it returns all records with parent of a current event.
I'm stuck with this dropdown list with filter. I was wondering if you might be able to help. Please |
@alphakitchown @Spotlight64 Let's unite together to solve this! |
@dxlvgcw solving this challenge on our own is near to impossible unless you are going to modify the source code on the form itself. as far as i know, apis are designed for your templates. you can modify the admin page by using uadmin functions. else, modify the source code but we cannot because it already violates computer ethics. best solution is we should request the uadmin developers this feature to include it as soon as possible we hope anyone who is more knowledgeable than us can help using the tools they have now. |
I still think it is possible. You just need to be dedicated to this until you find out the solution to the problem. Just feel like you are in the laboratory trying to find out the cure of 2019-nCOV. It does not matter whether it will take us one week, two weeks, or even one month. What really matters is it does not cache Javascript file. This is what we need to ask the developers of uadmin. |
this challenge is pretty easy if you are working on your templates. there are many strange situations when i work it on the admin page. this is why modifying the source code would be the best action go to templates > uadmin > default. open the html files inside. you will understand my point |
I think we you might be trying to reimplement inlines? https://uadmin-docs.readthedocs.io/en/latest/api/register_functions.html#uadmin-registerinlines |
If there is more to this issue please feel free to reopen it. |
Hello! I'm doing my first apllication based on uAdmin. When I'm trying to open model Kit I got this Error: https://play.golang.org/p/hsENK7L0f2U
Project: https://github.com/MarErm27/Events
The text was updated successfully, but these errors were encountered: