NavGrid does not work with JQGrid

I have an asp.net MVC application and I am trying to get jqgrid 3.5 to work in it. My grid doesn't use paging functionality, but I want to use the page navigation bar for the edit buttons. My grid in jquery tab control in content page. My data display works fine in the grid, but when I add the .navGrid () extension and its variants, it breaks the grid display (tabs go away) and the buttons are not displayed. Here is my grid ad - can anyone see what I'm missing. Or is there a way to determine what is causing it to break. I'm pretty desperate to get this job - Thanks in advance.

<script type="text/javascript">
jQuery(document).ready(function() {
    jQuery("#sandgrid").jqGrid({
        url: '/EquipTrack/GridData/',

    editurl: '/EquipTrack/Edit/', 
        datatype: 'json',
        mtype: 'GET',

        height: 255,
        width: 755,
        rowNum: 5000,
        colNames: ['ID', 'Type', 'Make', 'Model', 'Year', 'Location', 'Insp Due', 'Serv Due', 'Miles/Hrs', 'Milage Dt', 'Reg By', 'Mngd By', 'Tag Exp',''],
        colModel: [
         { name: 'equip_id', index: 'equip_id', width: 65, editable: true },
         { name: 'type_desc', index: 'type_desc', width: 130, editable: true },
         { name: 'make_descr', index: 'make_descr', width: 80, editable: true },
         { name: 'model_descr', index: 'model_descr', width: 80, editable: true },
         { name: 'equip_year', index: 'equip_year', width: 60, editable: true },
         { name: 'work_loc', index: 'work_loc', width: 130, editable: true },
         { name: 'insp_due_dt', index: 'insp_due_dt', width: 100, editable: true },
         { name: 'service_due_num', index: 'service_due_num', width: 80, editable: true },
         { name: 'miles_hours', index: 'miles_hours', width: 80, editable: true },
         { name: 'miles_dt', index: 'miles_dt', width: 100, editable: true },
         { name: 'registered_by', index: 'registered_by', width: 80, editable: true },
         { name: 'managed_by', index: 'managed_by', width: 80, editable: true },
         { name: 'tag_expire_dt', index: 'tag_expire_dt', width: 100, editable: true },
         { name: 'inspection_warn', index: 'tag_expire_dt', width: 0, hidden:true}],

        sortname: 'equip_id',
        sortorder: "asc",
        afterInsertRow: function(rowid, rowdata, rowelem) {
            if (rowelem[13] == 'SET_RED') {
                jQuery("#sandgrid").setCell(rowid, 'insp_due_dt', '', { color: 'red' })
            }
        },
        viewrecords: true,
        pager: jQuery('#sandgridp'),
        caption: 'Inventory'

    }).navGrid('#sandgridp',
     {view:true}, //options
      {height:290,reloadAfterSubmit:false, jqModal:false, closeOnEscape:true, bottominfo:"Fields marked with (*) are required"}, // edit options
      {height:290,reloadAfterSubmit:false,jqModal:false, closeOnEscape:true,bottominfo:"Fields marked with (*) are required"}, // add options
      {reloadAfterSubmit:false,jqModal:false, closeOnEscape:true}, // del options
      {closeOnEscape:true}, // search options
      {height: 250, jqModal: false, closeOnEscape: true} // view options
      );

    $('#sandgridp_center').remove();
    $('#sandgridp_right').remove();
});

      

+2


source to share


2 answers


OK - Tried playing with the syntax from other posted examples and got it working - don't notice any view options.



 }).navGrid('#sandgridp',
{}, //options
{reloadAfterSubmit:false}, // edit options
{reloadAfterSubmit:false}, // add options
{reloadAfterSubmit:false}, // del options
{} // search options
);

      

+2


source


Make sure you have enabled the form edit search function in your upload; otherwise, the function navGrid

will not be defined.



+2


source







All Articles