I am trying to accomplish the below functionality.
I am having a view which lists some custom type posts. I want the user to create them in front end and edit them inside the view. Right now I have on the image the add new CRED form. I want to have the edit button to display the edit form and hide the row with the current row.
Hello, this looks like a useful app. Unfortunately there is no show/hide toggle control built-in to Toolset Blocks, so the best solution would be to use classic Views, Forms, and some custom CSS and JavaScript. I can help you create an Edit Post Form and display that Form in each row of this View of custom posts, but some of the functionality you have described will require code that falls outside the scope of support I can provide here. You must write custom code to toggle the display of the existing post and the edit post form in each row using jQuery or standard JavaScript. I can help you find some examples of similar code online, but it would be your responsibility to make the toggle work on your own site. Another limitation here is that Forms must refresh the page to edit a post. This can create a problem where edits that are performed on another post in the list, but not submitted, are lost.
If these limitations are okay with you, let's continue the discussion. Have you created the Edit Post Form yet? If not, please create the Edit Post Form. Then insert the Edit Post Form in the View of posts you have created.
Have you created the Edit Post link to toggle the display of the post and the edit post form? If not, what is your experience level with JavaScript and jQuery, and have you tried any code yet to implement this effect?
Hello, and thank you for your response.
We are okay with limitations that you mention.
I have create the edit form post in the View.
I have an intermediate level of experience with JavaScript and jQuery. I can understand the code and I can implemented if you point me to the right direction.
Christian is currently on vacation at the moment so I will be assisting you with this one.
Based on this i've seen that you've setup your edit form already. Have you added the form to the view ? You will first need to add the form to the view and then add the button and the code to show/hide you form.
Also is the screenshot you sent previously from a CRED form setup? can you send me a link to the page itself ?
Below are the links for the page and a demo account in order for you to see the functionality so far.
Page link and login details. How can I send them without being public on the forum.
The screen shot is from a view where I have inside it a custom styled CRED form. This looks like the desired result.
I still need assistant with the below tasks:
- When clicking the edit button on the view row, show only the row's edit form. Not all the edit form.
- When clicking the update on the edit post form hide the update form and show the display row.
Below is the code on the View that has the functionality:
Also on the attached image I have the issue that I want the second textbox to be visible only when the first combo selection post is "Other". Need to do that functionality in javascript.
- When clicking the edit button on the view row, show only the row's edit form. Not all the edit form.
I would recommend that you take a look at the bootstrap collapse. Toolset includes bootstrap 4.0 and can be enabled by going to Toolset -> Settings and scroll to bootstrap loading. hidden link
This should allow you to create your toggle much easier as they have a built in scoping functionality with the data target attribute. You can generate dynamic ID's for this parameter using the post's ID so each button will be linked to its respective dropdown.
- When clicking the update on the edit post form hide the update form and show the display row.
For this you will need to set your form to reload the page in order to see the updated data. Simply updating the data in the form won't update the view's output so you need to set your form to redirect back to the listings page.