<div xmlns:py="http://genshi.edgewall.org/">
<table py:attrs="w.attrs" ></table>
<div py:if="w.pager_id" id="${w.pager_id}" />
<script type="text/javascript">
$(document).ready(
    function(){
        var opts = ${w.options};
        var grid = $("#${w.selector}");
        grid.jqGrid(opts);
        if ( 'pager' in opts ) {
            opts['pager_selector'] = opts['pager'];
            opts['pager'] = $(opts['pager'])

            var pager_opts = ${w.pager_options}
            var prmEdit = ${w.prmEdit};
            var prmAdd = ${w.prmAdd};
            var prmDel = ${w.prmDel};
            var prmSearch = ${w.prmSearch};
            var prmView  = ${w.prmView};

            grid.navGrid('#'+opts['pager_selector'], pager_opts,
                         prmEdit, prmAdd, prmDel, prmSearch, prmView)
            <py:for each="btn in w.custom_pager_buttons">
                .navButtonAdd('#'+opts['pager_selector'], ${btn})
            </py:for>;
        }
        <py:if test="w._prmFilter">
        var prmFilter = ${w.prmFilter};
        grid.jqGrid('filterToolbar', prmFilter);
        </py:if>
    }
);
</script>
</div>
