EditableGrid is an open source Javascript library aimed at turning HTML tables into advanced editable components. It focuses on simplicity: only a few lines of code are required to get your first table up and running.
Hello guys, I have a problem. I created a table connected to the database, and it all works. The problem is that I visiona only 9 columns, if they do not put more displays. How do I fix?
fetch_pairs is a simple method that transforms a mysqli_result object in an array.
It will be used to generate possible values for some columns.
_/
function fetch_pairs($connection,$query)
{
$sth=$connection->prepare($query);
$sth->execute();
$rows=$sth->fetchAll(/_PDO::FETCH_ASSOC*/);
//mi serve per usare le sessioni
InizializzaSessione();
//mi serve per usare le traduzioni
$app=new Lingue($Stringa_Connessione,$NomeUtente,$Password);
// create a new EditableGrid object
$grid = new EditableGrid();
$db_tablename = (isset($_GET['db_tablename'])) ? $_GET['db_tablename'] : 'T_UTENTI';
$connection = new PDO($str_conn,$config['db_user'],$config['db_password']);
/*
* Add columns. The first argument of addColumn is the name of the field in the databse.
* The second argument is the label that will be displayed in the header
*/
$grid->addColumn('ID', $app->GetTraduzione('IT','GRID_UTENTI_ID'), 'integer', NULL, false);
$grid->addColumn('NOME', $app->GetTraduzione('IT','GRID_UTENTI_USER'), 'string');
$grid->addColumn('PWD', $app->GetTraduzione('IT','GRID_UTENTI_PWD'), 'string');
$grid->addColumn('ABILITATO', $app->GetTraduzione('IT','GRID_UTENTI_ABILITATO'), 'string',fetch_pairs($connection,'select PAROLA, TRADUZIONE from T_LINGUE WHERE (Parola=\'T\' or Parola=\'F\') AND Lingua=\'' . GetSessione("LinguaUtente") . '\''),true);
$grid->addColumn('COGNOME_UTENTE', $app->GetTraduzione('IT','GRID_UTENTI_COGNOME'), 'string');
$grid->addColumn('NOME_UTENTE', $app->GetTraduzione('IT','GRID_UTENTI_NOME'), 'string');
$grid->addColumn('LINGUA', $app->GetTraduzione('IT','GRID_UTENTI_LINGUA'), 'string' , fetch_pairs($connection,'select LINGUA,DESCRIZIONE from T_LINGUE_LISTA ORDER BY Descrizione ASC'),true);
$grid->addColumn('LIVELLO', $app->GetTraduzione('IT','GRID_UTENTI_LIVELLO'), 'integer' , fetch_pairs($connection,'select ID, DESCRIZIONE from T_UTENTI_LIVELLI WHERE ID>=0 ORDER BY ID'),true);
Hello guys, I have a problem. I created a table connected to the database, and it all works. The problem is that I visiona only 9 columns, if they do not put more displays. How do I fix?
My code [code] <?php
/*
/**
require_once('config.php');
require_once('EditableGrid.php');
require_once('../../Sessioni.php');
require_once('../../Classi/Lingue.php');
/**
It will be used to generate possible values for some columns. _/ function fetch_pairs($connection,$query) { $sth=$connection->prepare($query); $sth->execute();
$rows=$sth->fetchAll(/_PDO::FETCH_ASSOC*/);
}
//mi serve per usare le sessioni InizializzaSessione(); //mi serve per usare le traduzioni $app=new Lingue($Stringa_Connessione,$NomeUtente,$Password);
// create a new EditableGrid object $grid = new EditableGrid(); $db_tablename = (isset($_GET['db_tablename'])) ? $_GET['db_tablename'] : 'T_UTENTI';
$grid->addColumn('PATH_DB', $app->GetTraduzione('IT','GRID_UTENTI_PATH_DB'), 'string',NULL, true);
$grid->addColumn('IMG', $app->GetTraduzione('IT','GRID_UTENTI_AVATAR'), 'string', NULL, true);
$grid->addColumn('action', $app->GetTraduzione('IT','GRID_UTENTI_AZIONE'), 'html', NULL, false, 'ID');
// send data to the browser $grid->renderXML($result); [/code]