Thx for all previous reactions.
We got all our tabledata into a json. It looks like this:
function neeminhoud()
{
var headers = [];
var InputsArray = [];
var Data = [];
var oTable = document.getElementById('tableDiagnose');
var rijen = oTable.rows.length;
//gets table
//loops through rows
var oCells = oTable.rows.item(0).cells;
//gets cells of current row
var cellLength = oCells.length;
for(var j = 0; j < cellLength; j++)
{
//loops through each cell in current row
<!--get your cell info here-->
//var cellVal = oCells.children[j].value;
if(j != 2)
{
if(j > 2)
{
headers[j] =oCells.item(j).innerHTML;
var cellVal = oCells.item(j).innerHTML;
//alert(cellVal);
}
else
{
headers[j-1] =oCells.item(j).innerHTML;
var cellVal = oCells.item(j).innerHTML;
//alert(cellVal);
}
}
}
for (i = 1; i < rijen; i++)
{
var inputs =
oTable.rows.item(i).getElementsByTagName("input");
var inputslengte = inputs.length;
var rijData = {};
for(var j = 0; j < inputslengte; j++)
{
//alert(inputs.length);
var inputval = inputs[j].value;
rijData[headers[j]] = inputval;
alert(inputval);
}
Data.push(rijData);
alert(Data);
}
}
Now we'd like to send it to our view using AJAX so we can send it to our
model/database.
How can we do this, cause we can't seem to find the documentation for this.
On Wednesday, March 13, 2013 4:42:30 PM UTC+1, Gert V wrote:
>
> We use pyramid and chameleon template.
>
> Currently we have a page where users can fill in a table.
> This table has a variable lenght because rows are added dynamically.
> We want to get all the content of the table and put it in a list, so we
> send it to our database.
>
> The biggest problem is that we don't know how to send the data to a list
> and get it to our vieuw.
> can some1 help me with this problem?
> thanks in advance.
>
>
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.