New topic Closed topic
avatar image
1
How can I trigger the loading of a collection again without refreshing?
By Created , last editted

Hi all,

I am using JQuery steps to help the user through a wizard. In the second step (Targets & Timeframe) a modal form can be launched by a button to add a new entry to the datamodel. I am using Ajax POST to add the record to the datamodel, since I don't want the page to refresh while the user is within the second step of the wizard. However, I want to have the result of the Ajax POST request to appear without reloading. To give you a better understanding of the challenge, see the process below:

Step 1 - A user fills in a name and selects a customer


Step 2 - Here targets can be added by using the the 'Create a new target' button which opens a modal form which content is submitted by using Ajax POST request (and yes, I know I should fix the alignment of the third input form ;-))

Step 3 - Now I want the result of the POST request to be added to the table as shown in the background. Is there a way to trigger the endpoint to load the collection "targets" again? So the {% for target in targets %} loop should also be triggered, without refreshing the whole page.
Is it an option to use the REST API for this? E.g. retrieving (somehow) all records by calling /models/TARGETS/records?filter_ids=FILTER-UUID and then appending the table with jQuery?

Another option - which I want to avoid - is to do a reload after each step in the Wizard, however - that's the elegance of Jquery Steps to not reload the page. In those circumstances, direct POST/GET request with the webserver through the use of Ajax is required. The jQuery datatables library offers an option for this, namely: jQuery.post (which loads data from the server using a HTTP POST request) and then  - after a new record has been added -  Ajax.reload (which reloads the table data from the Ajax data source). However, I cannot find a way to get it serverside working that BettyBlocks sends me the records back.


Any help is appreciated!
Arno


Hi all,

I am using JQuery steps to help the user through a wizard. In the second step (Targets & Timeframe) a modal form can be launched by a button to add a new entry to the datamodel. I am using Ajax POST to add the record to the datamodel, since I don't want the page to refresh while the user is within the second step of the wizard. However, I want to have the result of the Ajax POST request to appear without reloading. To give you a better understanding of the challenge, see the process below:

Step 1 - A user fills in a name and selects a customer


Step 2 - Here targets can be added by using the the 'Create a new target' button which opens a modal form which content is submitted by using Ajax POST request (and yes, I know I should fix the alignment of the third input form ;-))

Step 3 - Now I want the result of the POST request to be added to the table as shown in the background. Is there a way to trigger the endpoint to load the collection "targets" again? So the {% for target in targets %} loop should also be triggered, without refreshing the whole page.
Is it an option to use the REST API for this? E.g. retrieving (somehow) all records by calling /models/TARGETS/records?filter_ids=FILTER-UUID and then appending the table with jQuery?

Another option - which I want to avoid - is to do a reload after each step in the Wizard, however - that's the elegance of Jquery Steps to not reload the page. In those circumstances, direct POST/GET request with the webserver through the use of Ajax is required. The jQuery datatables library offers an option for this, namely: jQuery.post (which loads data from the server using a HTTP POST request) and then  - after a new record has been added -  Ajax.reload (which reloads the table data from the Ajax data source). However, I cannot find a way to get it serverside working that BettyBlocks sends me the records back.


Any help is appreciated!
Arno

  • Avatar image
    Did you find a solution?
    By
  • Login to reply
Answers
Sort by:

This topic is closed.