On Fri, Nov 14, 2008 at 17:21, Goran Juric <[EMAIL PROTECTED]> wrote:
>
> Can you post a snippet of your html?
>
> What the docs say is that on the html page you are displaying the grid on
> you must have a html element with an id pager2.
>
> Just put a <div id="pager2"></div> somewhere on the page.
>
I have that element. My view script:
<?php
$this->jquery()->enable()
->addStylesheet('/css/jquery/themes/basic/grid.css')
->addStylesheet('/css/jquery/themes/default/ui.all.css')
->addJavaScriptFile('/js/jquery/jquery.jqGrid.js');
$content = 'asddasdas';
?>
<?= $this->jqGrid('grid2', '', array(
'url' => '/artist/list/format/json/',
'datatype' => 'json',
'viewrecord' => 'true',
'height' => '100%',
'pager' => 'jQuery("#pager2")',
'imgpath' => "/css/jquery/themes/basic/images",
'colNames' => array('Id', 'Nazwa'),
'colModel' => array(
array('name' => 'artist_id', 'index' => 'index_id', 'width'
=> 55),
array('name' => 'artist_name', 'index' => 'artist_name',
'width' => 300),
),
'caption' => 'Siała baba mak.'
)) ?>
It generate html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html>
<head>
<title></title>
<link rel="Stylesheet"
href="/css/jquery/themes/basic/grid.css" type="text/css" />
<link rel="Stylesheet" href="/css/jquery/themes/default/ui.all.css"
type="text/css" />
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.5.2/jquery-ui.min.js"></script>
<script type="text/javascript" src="/js/jquery/jquery.jqGrid.js"></script>
<script type="text/javascript">
//<![CDATA[
$(document).ready(function() {
$("#grid2").jqGrid({"url":"\/artist\/list\/format\/json\/","datatype":"json","viewrecord":"true","height":"100%","pager":"jQuery(\"#pager2\")","imgpath":"\/css\/jquery\/themes\/basic\/images","colNames":["Id","Nazwa"],"colModel":[{"name":"artist_id","index":"index_id","width":55},{"name":"artist_name","index":"artist_name","width":300}],"caption":"Sia\u0142a
baba mak."});
});
//]]>
</script> </head>
<body>
<div id="content">
<table id="grid2" class="scroll" cellpadding="0" cellspacing="0"/><div
id="pager2" class="scroll" style="text-align:center;"/> </div>
<div id="nav"></div></body>
</html>
both: <table> and <div> are displayed by helper. Grid is displayed but
without pager.
--
Paweł Chuchmała
pawel.chuchmala at gmail dot com