The djqgrid Template Tag — djqgrid 0.2 documentation

### Navigation

- index
- modules |
- next |
- previous |
- djqgrid 0.2 documentation »
- Reference »

# The djqgrid Template Tag

To use djqgrid in a template, you need to load the djqgrid template tag first, using

`{% load jqgrid %}`

`djqgrid.templatetags.jqgrid.` `jqgrid`(context, grid, prefix='', pager=True, urlquery=None, **kwargs)

  Adds a complete jqGrid - HTML and JavaScript - to the template.

  Two HTML elements are added, a `<table id='grid'>` and a `<div id='pager'>`. JavaScript code to initialize the jqGrid is also added.

  After the grid is set up in the browser, it will access the server again and ask for the grid data. The URL is defined in the Grid object, and is appended by the `urlquery` argument and the current request’s query dict. For example, if the template is rendering the URL `/view?p=1`, the grid’s URL is `/grid/17?g=2` and `urlquery` is `q=3`, the grid’s data will be retrieved from `/grid/17?g=2&q=3&p=1`

  Args:

    context - The template context grid - the Grid prefix - A prefix for the grid and pager element IDs. The default is no prefix, meaning the elements are

    > named `grid` and `pager`. Adding `prefix='prefix'` creates elements with the IDs `prefix-grid` and `prefix-pager`.

    pager - True if a pager is added to the grid. If no pager is added, the row count is set to 99,999. urlquery - An additional query string that will be added to the data request that will be sent to the server. **kwargs - All additional arguments are added as is to the jqGrid initialization option object.

  Returns:
    The generated HTML

### Navigation

- index
- modules |
- next |
- previous |
- djqgrid 0.2 documentation »
- Reference »