Ashish Mehta
Ashish Mehta

Reputation: 7426

Use of inline Nav in jqgrid

I am use Jqgrid. In which i use inine nav for add new rows. My Inline nav code

jQuery("#list").jqGrid('inlineNav','#Pager',
{
 editParams : {
   extraparam : {
    extraParamId : function() {
            return allExtraId;
    }
   }
 }
});

So my Question is that when i am use inlineNav so this code navGrid is require or not

jQuery("#list").jqGrid('navGrid','#Pager', {
 edit : false,
 add : false    
});

Please Reply.... Thanks in Advance..

Upvotes: 1

Views: 3723

Answers (1)

Oleg
Oleg

Reputation: 221997

The call of navGrid is really required before calling of inlineNav. The reason is that the pager creates per default only three parts: left, center and right. The parts as as <td> elements of the row of table in the pager. For example if you don't call navGrid you will have empty left part of the pager like below:

<td align="left" id="pager_left"></td>

If you call navGrid for example in the form

$("#grid").jqGrid("navGrid", "#pager",
    {add: false, edit: false, del: false, search: false, refresh: false});

the left part of the pager will be changed to

<td align="left" id="pager_left">
    <table class="ui-pg-table navtable"
           style="float: left; table-layout: auto;"
           border="0" cellspacing="0" cellpadding="0">
        <tbody><tr></tr></tbody>
    </table>
</td>

The current implementation of inlineNav just uses navButtonAdd to add additional buttons to the navigator which must be created before. How you will see from the line of code the method navButtonAdd uses $(".navtable", "#pager") to find the navigator table inside of the pager. Only if the navigator will be found the method navButtonAdd add additional buttons inside of it.

So you really need first create the navigator bar in the pager before you call inlineNav.

Upvotes: 2

Related Questions