How to add a table in django form? - django-forms

I am creating a Django form which requires several details to be filled by user (number of pieces and dimensions) so I was thinking to include a table in the form.This is only a info collector and would not go to database. Is this possible?

You can use {{form.as_table}} template tag built in django.
{{form.as_table}} returns only <\tr>...</tr>. You would have to explicitly put the wrapper around.
For more visit https://docs.djangoproject.com/en/1.9/topics/forms/

Related

How to create html element for each object in collection?

I have String like this:
{"response":{"count":997,"items":[{"id":2943,"first_name":"Vasya","last_name":"Babich","can_access_closed":true,"is_closed":false,"screen_name":"antanubis","track_code":"24fc13d6ZwhuhzyM9V1oRkohiruY-zXeoP1aliqA-1dA4qgxJrQAYSTQYe6kVWsTTKkXWWybQrHU"},{"id":231329886,"first_name":"Vasya","last_name":"Babich","can_access_closed":true,"is_closed":false,"screen_name":"lydka_lydka_lydka","track_code":"a348ab0aAo3CxaTAGsTDu4mpMdBMMjYxgAmOnr7PvUWgaanh141l5NGe_PlLz8a8unX1eOUxXj-GCo6esKk"}]}}
I want to show each value of "items" to user in browser and then user should be able to select one of them and save in database and in his own page in the website. I guess I should use loop and create html element for each item. But how to do this? What data type should I use to manipulate this data and store it?
Thymeleaf is the most widely used view/template engine with Spring Boot and can handle your loop requirement. Spring MVC enables you to manage your app behavior and define the data bound to HTML pages (views). You will need a database and there are lots of options. Check out Spring Data which makes it easy to work with all major database technologies.

creating dynamic records in single form using JS and store the info in a List or set object using spring mvc

I need to create form fields like name , age and city inside a form and this should happen every time i click add record. i dont want multiple forms all dynamic group should be created within a single form. on submitting the data should be taken by controller using modelattribute, and store in arraylist or any ...help out to find it. i have used following links and almost got it but unfortunately got deleted.
https://viralpatel.net/blogs/spring-mvc-multi-row-submit-java-list/
http://www.nobukimi.com/?p=237
answer
https://netjs.blogspot.com/2018/09/spring-mvc-binding-list-of-objects-example.html

How to improve Angular2 rendering performances when accessing a backend server?

I have a service which is responsible for getting the data from a backend.
The data is shown via a component in its nginit method. It is shown in a table (html table).
I would like to be able to manipulate data without having to reload it each time in my table : ex : delete a row, add a row ... I want all of this very fluid. The data is coming from a database.
So my question is :
Should my service return an observable or an array ?
Is nginit the best place to show my table ?
How should I do things maybe to manage everything in memory? I do not know.
Thanks for any advice.
I would save the data into an array then use lodash to manipulate it.
You could edit, delete, and add rows using lodash's built in functions. When you want to save the data to the backend you would then post the array back to the server. This will keep backend requests to a minimum which will help your performance.
For example you could delete elements from the array using the remove function, https://lodash.com/docs/4.17.4#remove
Lodash can be setup like this https://medium.com/#gtsopour/importing-lodash-into-angular-2-typescript-application-94590365f46d#.9mdcdjnac
Of course you could do this all using raw js though but I find Lodash very rich and easy to use.

Overview of all fluidcontent FCEs

For complex TYPO3 project using fluidcontent I'm looking for a tool, which show me the followering informations:
which FCE exists
how often and on what pages are they in use
which partials are used
which flux form fields are used (with name and type)
diposit some meta informations, e.g. tags, description ...
How would be the smartest way to implement this library in a typo3 project?
My idea is, to develop an extension which read the fluidcontent templates and show the informations in a frontend plugin with examples. But i have no idea to read out the information like "used partials" or "used flux form fields".
Any ideas?
Thanks.
FCE's are just cType elements in the tt_content table. you can write a simple query to count the different cTypes, thus gives you a list with all the used FCE's on your site. you can know on witch page they are used because every tt_content entry has a pageUId
for the flux fields. you will have to create a function that fetch all content elements that uses flux and then parse all the flexform fields. note that flux can also store data in other fields then flexform xml.
you can create a basic extbase plugin for this to show it in the front or backend

Generate dynamic form and store the data in Laravel

For a part of my next project I'm looking for the following information.
I'm trying to make an application for something like scouts, all the supervisors will have a user account on the application and the supervisors will be able to manage the members of the scouts. I'm looking for a way to let the supervisor decide what information they would like to store about the member. This will then be converted to a form so they can easily add new members.
What is the best way to make a dynamic form and store the data in a database.
Thanks in advance!
Well there are many ways to do that, so I don't know if this is the best with the little information you give us about your "case scenario".
I'll do create this tables:
forms (hold the form basic info and supervisors reference)
forms_fields (with an Elquent relatinship tipy "belongsTo")
Check Laravel documentation on Eloquent here>

Resources