Single Block, Multiple Tables
Permalink
Hello,
Please simple explain me for how use a basic Ajax for edit and add.php
I am looking for single block, multiple tables
In edit or add.php->table 1
click add to new input
1. input value -> database table 2
Click add to new input
2. input value -> database table 2
Thanks in advance
Please simple explain me for how use a basic Ajax for edit and add.php
I am looking for single block, multiple tables
In edit or add.php->table 1
click add to new input
1. input value -> database table 2
Click add to new input
2. input value -> database table 2
Thanks in advance
For an extending list - which unless the list gets very big is much easier than doing it by Ajax - see
http://www.concrete5.org/documentation/how-tos/designers/create-a-f...
Unless you have a lot of values and need fully relational searching, your table structure can be simplified by serialising or imploding the returned array of inputs to an X2 in the block table.
http://www.concrete5.org/documentation/how-tos/designers/create-a-f...
Unless you have a lot of values and need fully relational searching, your table structure can be simplified by serialising or imploding the returned array of inputs to an X2 in the block table.
The whole thing can be async saved from add or edit, but the problem you will run into, at least from the save perspective is that you don't actually have a bID until the actual underlying block record (and its id to hang stuff off of) is in fact saved, so again your relational tables won't have an accurate foreign key to work off of.
If you want to include a form on the live side without actually using the add/edit ui entirely that is possible, but it will require the block to be added in some way to actually show the form itself. My google maps add on does this, and people seem to really like it :)
If you want to include a form on the live side without actually using the add/edit ui entirely that is possible, but it will require the block to be added in some way to actually show the form itself. My google maps add on does this, and people seem to really like it :)
http://www.concrete5.org/documentation/how-tos/developers/ajax-less...
There are alternatives too. You don't have to go the ajax save route, you can use javascript to add fields, complete the values and catch when you save the block by extending the blocks save method.
You just need to be able to identify the post fields you sent and iterate through them. Drop all rows for that blockid and insert new data.
Hope that helps