:: Forum >> Version 2 >>

How change the table size?

More information on this topic is available in the documentation section: /grid.examples/php-mysql.html.

can be changed size of the table? that it is but great? It wanted that it is possible to be printed but they do not print all columnas.
ok?
Gracias
Paula
Sorry, but my english is very bad!!

//////
<?php

$inventario = @mysql_connect('localhost', 'user', 'pass');
@mysql_select_db('stock', $inventario);
$query = 'SELECT * FROM clientes LIMIT 0,20';
$dataset = @mysql_query($query, $inventario);


// 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/xp/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 =["Nombre","Cód. Navision","Fecha alta","Usuario alta","Fecha modif.","Usuario modif.","fecha baja","Usuario baja cliente","Motivo baja"]
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>

paula enews@iespana.es
Friday, May 4, 2007
You can change the size of each control with setSize() method -

http://www.activewidgets.com/aw.system.html/setsize.html
Alex (ActiveWidgets)
Friday, May 4, 2007
Thank you!!!!!!

Paula
Sunday, May 6, 2007



This topic is archived.

Back to /grid.examples/php-mysql.html

Documentation:

Forum search