On 3 April 2011 20:14, Joschi Cassel <[email protected]> wrote:
> I do recall that now. Thank you. It just fits so perfectly to use
> the ID of the sql table row as the ID of the matching HTML table
> row :) What is your preferred method when populating a table with
> results from a query?
>
> Thank you,
> Joschi
>
If I'm building a table to hold multiple rows, then I don't use IDs at
all as the IDs will change for every row/page being viewed, so all the
build-up/tear-down for every pagination would seem to be redundant.
Instead, I'd code the client to rely on bubbled events so that I only
need to add 1 event to the container that won't change for each
pagination.
My input tag names would be along the lines of ...
name="tableName[id][column1Name]"
That way, when they get to PHP, I have a nested array of data which
matches the structure of the data I would need to insert into the DB
as well as the structure of the data I would get from the DB.
So, 1 pattern of coding logic.
foreach($_POST['tableName'] as $i_ID => $a_Row) {
// Validate data
// $i_ID === int > 0
// $a_Row['column1Name'] === string / regex / etc.
// Process row.
}
Sort of thing.
--
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY
--
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en.