PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.php > Open Source PHP version of ASP.NET DataGrid or GridView?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Open Source PHP version of ASP.NET DataGrid or GridView?

Réponse
 
LinkBack Outils de la discussion
Vieux 13/02/2008, 20h32   #1
wrburgess
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Open Source PHP version of ASP.NET DataGrid or GridView?

I am trying to find a PHP control, framework, or application that has
a behavior equivalent to the ASP.NET DataGrid or GridView controls.
Other terms I've seen are "HTML Table", "Table View", or "Database
Grid."

I know you can hand-code a database query that prints out an HTML
table, but I'm looking for a re-suable control that can consume a DB
query and return HTML-compliant tabled data.

I'm aiming for something in the open source realm, if possible. Any
suggestions are appreciated.
  Réponse avec citation
Vieux 14/02/2008, 12h45   #2
C. (http://symcbean.blogspot.com/)
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Open Source PHP version of ASP.NET DataGrid or GridView?

On 13 Feb, 20:32, wrburgess <wrburg...@gmail.com> wrote:
> I am trying to find a PHP control, framework, or application that has
> a behavior equivalent to the ASP.NET DataGrid or GridView controls.
> Other terms I've seen are "HTML Table", "Table View", or "Database
> Grid."
>
> I know you can hand-code a database query that prints out an HTML
> table, but I'm looking for a re-suable control that can consume a DB
> query and return HTML-compliant tabled data.
>
> I'm aiming for something in the open source realm, if possible. Any
> suggestions are appreciated.


phplens is probably the most complete/usable solution I've come across

C.
  Réponse avec citation
Vieux 14/02/2008, 23h41   #3
Betikci Boris
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Open Source PHP version of ASP.NET DataGrid or GridView?

On Feb 13, 10:32 pm, wrburgess <wrburg...@gmail.com> wrote:
> I am trying to find a PHP control, framework, or application that has
> a behavior equivalent to the ASP.NET DataGrid or GridView controls.
> Other terms I've seen are "HTML Table", "Table View", or "Database
> Grid."
>
> I know you can hand-code a database query that prints out an HTML
> table, but I'm looking for a re-suable control that can consume a DB
> query and return HTML-compliant tabled data.
>
> I'm aiming for something in the open source realm, if possible. Any
> suggestions are appreciated.


$connection = @mysql_connect('localhost', 'user', 'password');
@mysql_select_db('database', $connection);
$query = 'SELECT * FROM myTable LIMIT 0,10';
$dataset = @mysql_query($query, $connection);


// print MySQL query results as 2D javascript array
function aw_cells($dataset){

$rows = array();
while ($record = @mysql_fetch_row($dataset)) {
$cols = array();
foreach ($record as $value) {
$cols[] = '"'.addslashes($value).'"';
}
$rows[] = "\t[".implode(",", $cols)."]";
}
echo "[\n".implode(",\n",$rows)."\n];\n";
}

// print MySQL field names as javascript array
function aw_headers($dataset){
while ($field = @mysql_fetch_field($dataset)) {
$cols[] = '"'.$field->name.'"';
}
echo "[".implode(",",$cols)."];\n";
}

?>
<html>
<head>
<!-- include AW stylesheet and script -->
<link href="../../runtime/styles/system/aw.css" rel="stylesheet"
type="text/css" ></link>
<script src="../../runtime/lib/aw.js"></script>
</head>
<body>
<script>

// insert javascript arrays produced by PHP functions
var myHeaders = <?= aw_headers($dataset) ?>
var myCells = <?= aw_cells($dataset) ?>

// create grid control
var obj = new AW.UI.Grid;

// set grid text
obj.setHeaderText(myHeaders);
obj.setCellText(myCells);

// set number of columns/rows
obj.setColumnCount(myHeaders.length);
obj.setRowCount(myCells.length);

// write grid to the page
document.write(obj);

</script>
</body>
</html>
  Réponse avec citation
Vieux 14/02/2008, 23h46   #4
Betikci Boris
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Open Source PHP version of ASP.NET DataGrid or GridView?

On Feb 15, 1:41 am, Betikci Boris <pard...@gmail.com> wrote:
> On Feb 13, 10:32 pm, wrburgess <wrburg...@gmail.com> wrote:
>
> > I am trying to find a PHP control, framework, or application that has
> > a behavior equivalent to the ASP.NET DataGrid or GridView controls.
> > Other terms I've seen are "HTML Table", "Table View", or "Database
> > Grid."

>
> > I know you can hand-code a database query that prints out an HTML
> > table, but I'm looking for a re-suable control that can consume a DB
> > query and return HTML-compliant tabled data.

>
> > I'm aiming for something in the open source realm, if possible. Any
> > suggestions are appreciated.

>
> $connection = @mysql_connect('localhost', 'user', 'password');
> @mysql_select_db('database', $connection);
> $query = 'SELECT * FROM myTable LIMIT 0,10';
> $dataset = @mysql_query($query, $connection);
>
> // print MySQL query results as 2D javascript array
> function aw_cells($dataset){
>
> $rows = array();
> while ($record = @mysql_fetch_row($dataset)) {
> $cols = array();
> foreach ($record as $value) {
> $cols[] = '"'.addslashes($value).'"';
> }
> $rows[] = "\t[".implode(",", $cols)."]";
> }
> echo "[\n".implode(",\n",$rows)."\n];\n";
>
> }
>
> // print MySQL field names as javascript array
> function aw_headers($dataset){
> while ($field = @mysql_fetch_field($dataset)) {
> $cols[] = '"'.$field->name.'"';
> }
> echo "[".implode(",",$cols)."];\n";
>
> }
>
> ?>
> <html>
> <head>
> <!-- include AW stylesheet and script -->
> <link href="../../runtime/styles/system/aw.css" rel="stylesheet"
> type="text/css" ></link>
> <script src="../../runtime/lib/aw.js"></script>
> </head>
> <body>
> <script>
>
> // insert javascript arrays produced by PHP functions
> var myHeaders = <?= aw_headers($dataset) ?>
> var myCells = <?= aw_cells($dataset) ?>
>
> // create grid control
> var obj = new AW.UI.Grid;
>
> // set grid text
> obj.setHeaderText(myHeaders);
> obj.setCellText(myCells);
>
> // set number of columns/rows
> obj.setColumnCount(myHeaders.length);
> obj.setRowCount(myCells.length);
>
> // write grid to the page
> document.write(obj);
>
> </script>
> </body>
> </html>


i will post the aw.js
  Réponse avec citation
Vieux 14/02/2008, 23h50   #5
Betikci Boris
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Open Source PHP version of ASP.NET DataGrid or GridView?

On Feb 15, 1:41 am, Betikci Boris <pard...@gmail.com> wrote:
> On Feb 13, 10:32 pm, wrburgess <wrburg...@gmail.com> wrote:
>
> > I am trying to find a PHP control, framework, or application that has
> > a behavior equivalent to the ASP.NET DataGrid or GridView controls.
> > Other terms I've seen are "HTML Table", "Table View", or "Database
> > Grid."

>
> > I know you can hand-code a database query that prints out an HTML
> > table, but I'm looking for a re-suable control that can consume a DB
> > query and return HTML-compliant tabled data.

>
> > I'm aiming for something in the open source realm, if possible. Any
> > suggestions are appreciated.

>
> $connection = @mysql_connect('localhost', 'user', 'password');
> @mysql_select_db('database', $connection);
> $query = 'SELECT * FROM myTable LIMIT 0,10';
> $dataset = @mysql_query($query, $connection);
>
> // print MySQL query results as 2D javascript array
> function aw_cells($dataset){
>
> $rows = array();
> while ($record = @mysql_fetch_row($dataset)) {
> $cols = array();
> foreach ($record as $value) {
> $cols[] = '"'.addslashes($value).'"';
> }
> $rows[] = "\t[".implode(",", $cols)."]";
> }
> echo "[\n".implode(",\n",$rows)."\n];\n";
>
> }
>
> // print MySQL field names as javascript array
> function aw_headers($dataset){
> while ($field = @mysql_fetch_field($dataset)) {
> $cols[] = '"'.$field->name.'"';
> }
> echo "[".implode(",",$cols)."];\n";
>
> }
>
> ?>
> <html>
> <head>
> <!-- include AW stylesheet and script -->
> <link href="../../runtime/styles/system/aw.css" rel="stylesheet"
> type="text/css" ></link>
> <script src="../../runtime/lib/aw.js"></script>
> </head>
> <body>
> <script>
>
> // insert javascript arrays produced by PHP functions
> var myHeaders = <?= aw_headers($dataset) ?>
> var myCells = <?= aw_cells($dataset) ?>
>
> // create grid control
> var obj = new AW.UI.Grid;
>
> // set grid text
> obj.setHeaderText(myHeaders);
> obj.setCellText(myCells);
>
> // set number of columns/rows
> obj.setColumnCount(myHeaders.length);
> obj.setRowCount(myCells.length);
>
> // write grid to the page
> document.write(obj);
>
> </script>
> </body>
> </html>


I can't put the aw.js here but you can go http://www.activewidgets.com/
to see the datagrid script examples in there.
  Réponse avec citation
Vieux 15/02/2008, 01h57   #6
Ali Bobo
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Open Source PHP version of ASP.NET DataGrid or GridView?

On Feb 13, 9:32 pm, wrburgess <wrburg...@gmail.com> wrote:
> I am trying to find a PHP control, framework, or application that has
> a behavior equivalent to the ASP.NET DataGrid or GridView controls.
> Other terms I've seen are "HTML Table", "Table View", or "Database
> Grid."
>
> I know you can hand-code a database query that prints out an HTML
> table, but I'm looking for a re-suable control that can consume a DB
> query and return HTML-compliant tabled data.
>
> I'm aiming for something in the open source realm, if possible. Any
> suggestions are appreciated.


Not sure if it will suit you, but TYPO3 currently supports MySQL,
Oracle, Microsoft SQL Server, Sybase, Sybase SQL Anywhere, DB2,
Informix, PostgreSQL, FrontBase, Interbase (Firebird and Borland
variants), Foxpro, Access, ADO, SAP DB, SQLite and ODBC.

http://typo3.com/Feature_list.1243.0.html
  Réponse avec citation
Vieux 15/02/2008, 03h28   #7
Jerry Stuckle
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Open Source PHP version of ASP.NET DataGrid or GridView?

Ali Bobo wrote:
> On Feb 13, 9:32 pm, wrburgess <wrburg...@gmail.com> wrote:
>> I am trying to find a PHP control, framework, or application that has
>> a behavior equivalent to the ASP.NET DataGrid or GridView controls.
>> Other terms I've seen are "HTML Table", "Table View", or "Database
>> Grid."
>>
>> I know you can hand-code a database query that prints out an HTML
>> table, but I'm looking for a re-suable control that can consume a DB
>> query and return HTML-compliant tabled data.
>>
>> I'm aiming for something in the open source realm, if possible. Any
>> suggestions are appreciated.

>
> Not sure if it will suit you, but TYPO3 currently supports MySQL,
> Oracle, Microsoft SQL Server, Sybase, Sybase SQL Anywhere, DB2,
> Informix, PostgreSQL, FrontBase, Interbase (Firebird and Borland
> variants), Foxpro, Access, ADO, SAP DB, SQLite and ODBC.
>
> http://typo3.com/Feature_list.1243.0.html
>


What - no DBASE III support? :-)

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

  Réponse avec citation
Vieux 15/02/2008, 18h06   #8
wrburgess
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Open Source PHP version of ASP.NET DataGrid or GridView?

Thanks for the replies!
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 17h17.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,20846 seconds with 16 queries