$("#grid_id").setGridWidth($('#box-content').width(), true);
con esto no necesariamente deberemos asignar un width estático en las propiedades del elemento jqgrid
Nos leemos en la proxima entrada.
Lo unico que nos falta por hacer, es lo que aun no hemos intentado ....
<?php// Connecting, selecting database
$link = mysql_connect('localhost', 'myuser', 'mypassword');
mysql_select_db('blog_db', $link);
// Performing SQL query
$result = mysql_query('SELECT date, title FROM post', $link);
?>
<html>
<head>
<title>List of Posts</title>
</head>
<body>
<h1>List of Posts</h1>
<table>
<tr><th>Date</th><th>Title</th></tr>
<?php
// Printing results in HTML
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
echo "<tr>";
printf("<td> %s </td>", $row['date']);
printf("<td> %s </td>", $row['title']);
echo "</tr>";
}
?>
</table>
</body>
</html>
<?php
// Closing connection
mysql_close($link);
?>
<?php// Connecting, selecting database
$link = mysql_connect('localhost', 'myuser', 'mypassword');
mysql_select_db('blog_db', $link);
// Performing SQL query
$result = mysql_query('SELECT date, title FROM post', $link);
// Filling up the array for the view
$posts = array();
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$posts[] = $row;
}
// Closing connection
mysql_close($link);
// Requiring the view
require('view.php');
<html>
<head>
<title>List of Posts</title>
</head>
<body>
<h1>List of Posts</h1>
<table>
<tr><th>Date</th><th>Title</th></tr>
<?php foreach($posts as $post): ?><tr>
<td><?php echo $post['date'] ?></td>
<td><?php echo $post['title'] ?></td>
</tr><?php endforeach; ?>
</table>
</body>
</html>
<?phpfunction getAllPosts()
{
// Connecting, selecting database
$link = mysql_connect('localhost', 'myuser', 'mypassword');
mysql_select_db('blog_db', $link);
// Performing SQL query
$result = mysql_query('SELECT date, title FROM post', $link);
// Filling up the array
$posts = array();
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$posts[] = $row;
}
// Closing connection
mysql_close($link);
return $posts;
}
<?php// Requiring the model
require_once('model.php');
// Retrieving the list of posts
$posts = getAllPosts();
// Requiring the view
require('view.php');
function pdf_create($html, $filename, $stream=TRUE)
{
require_once("dompdf/dompdf_config.inc.php");
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
if ($stream) {
$dompdf->stream($filename.".pdf");
} else {
$CI =& get_instance();
$CI->load->helper('file');
write_file("./invoices_temp/invoice_$filename.pdf", $dompdf->output());
}
}
function pdf ()
{
$data = 0;
$this ->load->plugin('to_pdf');
$html = $this->load->view( 'welcome_message' , $data , true );
pdf_create ($html,'pruebas');
}