If you benefit from web2py hope you feel encouraged to pay it forward by contributing back to society in whatever form you choose!


  • 0
    pbnan  13 years ago
    Some missing parts in the code above: @tomyblack: there is no closing for < table id = "list" > < div id = "pager" >
    @mr.freeze Currently, in controller, order of included files should be different (it requires to copy "jquery-ui" to "/static/jqueryui" and "jqgrid" to "/static/jquery.jqGrid":
    def index():
        response.files.append(URL(r=request,c='static/jqueryui/css/smoothness',f='jquery-ui-1.8.11.custom.css'))
        response.files.append(URL(r=request,c='static/jquery.jqGrid/css',f='ui.jqgrid.css'))
        response.files.append(URL(r=request,c='static/jqueryui/js',f='jquery-ui-1.8.11.custom.min.js'))    
        response.files.append(URL(r=request,c='static/jquery.jqGrid/src/i18n',f='grid.locale-en.js'))
        response.files.append(URL(r=request,c='static/jquery.jqGrid/js',f='jquery.jqGrid.min.js'))
        return dict()
    
    Edit: to change every edit window width + other features use the following on the beginning of your view.html:
    jQuery.extend(jQuery.jgrid.edit, {
        closeAfterAdd: true,
        closeAfterEdit: true,
        recreateForm: true,
        closeOnEscape:true,
        width:390
    });
    

Commented on:

This is a simple example of how to get started with jqGrid on web2py

Hosting graciously provided by:
Python Anywhere