R K Sharma
R K Sharma

Reputation: 855

Is it possible to set paging false in jqgrid?

i have added pager:"#pager" but now i don't think that i need paging so i just need a add button(+), son can anybody tell me how to set paging false without removing the whole bar..just remove pagging

 grid.jqGrid('navGrid', '#pager',
        { resize: false, add: false, search: false, del: false, refresh: false, edit: false, alerttext: 'Please select one user' }

    ).jqGrid('navButtonAdd', '#pager',
        { title: "Add New users", buttonicon: "ui-icon ui-icon-plus", onClickButton: showNewUsersModal, position: "First", caption: "" });

Upvotes: 4

Views: 14400

Answers (2)

jeffery_the_wind
jeffery_the_wind

Reputation: 18158

I was able to accomplish this without having to use the navButtonAdd method. Simply set the pgbuttons, pginput properties to false and pgtext to "". Configure the navGrid properties as you would otherwise.

Testing used free-jqgrid. https://github.com/free-jqgrid

$('#grid_id').jqGrid({
    url:'url',
    editurl:'edit_url',
    height: 'auto',
    shrinkToFit: true,
    width: 280,
    datatype: 'xml',
    mtype: 'POST',
    postData:{
        ...
    },
    colNames:[
        ...
    ],
    colModel:[
        ...
    ],
    sortname: 'idsort',
    sortorder: 'asc',
    viewrecords: true,
    gridview: true,
    caption: 'Caption',
    pager: true,
    rowNum: 10000,
    pgbuttons: false,
    pginput: false,
    pgtext: ""
});
$('#grid_id').jqGrid("navGrid", 
    { 
        position:"center", 
        iconsOverText: true, 
        addtext: "Add", 
        edit: false, 
        deltext: "Delete", 
        search: false, 
        refreshtext: "Reload", 
        view: false 
    }
);

Upvotes: 2

kmas
kmas

Reputation: 6439

Read this : pager properties.

You have to set pgbuttons, pginput to false to do what you want.

grid = $("#your_table").jqGrid({
   // all your options
   pgbuttons : false,
   viewrecords : false,
   pgtext : "",
   pginput : false
});
grid.jqGrid('navGrid', '#pager',
    { resize: false, add: false, search: false, del: false, refresh: false, edit: false,    alerttext: 'Please select one user' }

).jqGrid('navButtonAdd', '#pager',
    { title: "Add New users", buttonicon: "ui-icon ui-icon-plus", onClickButton: showNewUsersModal, position: "First", caption: "" });

Upvotes: 7

Related Questions