[PHP] table mixing PHP, javascript, ajax and CSS

2008-12-28 Thread Alain Roger
Hi,

i'm currently working on some project which needs in several pages, a table
to display query results...till now nothing special.
however, in order to not create several time the table and features i've
decided to create my own templates including PHP classes, CSS and
javascript.

this table class should have filter, colors schemes, multi selection and
header/paging header.
I would like to know what are your suggestions, recommendations or tips to
have something easy to deploy and upgrade ?

i was thinking to have a common (framework) base : a simple html file having
3 divs, each div receiving a particular php file (header, pagin, or the
table itself)
header, paging or table PHP files could be located in some folder being
different for each template... main changes in templates are usually for the
table it self (in terms of columns amount, of presented data record,...)

basically my structure is the following one:
/folder_to_include_by_user_in_his_development_environment
   /templates
  /template1
 pager.php
 table.php
  /template2
 pager.php
 table.php
  header.php
   frame.php
   /class
  table_class.php
  helping_classes.php
  ...
   /js_and_ajax
 function.js

the user will have only to run a js function which will include the
frame.php file into his own webpage with the template given as parameter.

thx for any suggestion.

-- 
Alain
---
Windows XP x64 SP2 / Fedora 10 KDE 4.2
PostgreSQL 8.3.5 / MS SQL server 2005
Apache 2.2.10
PHP 5.2.6
C# 2005-2008


Re: [PHP] table mixing PHP, javascript, ajax and CSS

2008-12-28 Thread Benjamin Hawkes-Lewis

On 28/12/08 13:33, Alain Roger wrote:


i'm currently working on some project which needs in several pages, a table
to display query results...till now nothing special.
however, in order to not create several time the table and features i've
decided to create my own templates including PHP classes, CSS and
javascript.

this table class should have filter, colors schemes, multi selection and
header/paging header.


An appropriate set of classes (data types, field names, even/odd 
designators for zebra styling) plus CSS is everything you need for color 
schemes.


Can you elaborate on what you mean by multi selection and paging header?


I would like to know what are your suggestions, recommendations or tips to
have something easy to deploy and upgrade ?


I'd look into:

http://developer.yahoo.com/yui/datatable/

It includes filtering.

I usually write my own code for generating raw table markup - that could 
be used by as a progressive enhancement by YUI datatable - with a 
minimum of repetition.


http://www.webaim.org/techniques/tables/data.php has information about 
what constitutes good markup for data tables.



i was thinking to have a common (framework) base : a simple html file having
3 divs, each div receiving a particular php file (header, pagin, or the
table itself)
header, paging or table PHP files could be located in some folder being
different for each template... main changes in templates are usually for the
table it self (in terms of columns amount, of presented data record,...)

the user will have only to run a js function which will include the
frame.php file into his own webpage with the template given as parameter.


The use of JS as an include mechanism is largely pernicious. Couldn't 
they just use include()?


--
Benjamin Hawkes-Lewis

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php