2010-04-22 16 views
10

यहाँ मेरी कोडशीर्ष पर jqgrid में 2 पेजर और नीचे एक कैसे है? jqGrid विकल्पों की सूची के लिए:

$(document).ready(function() { 
    $('#jqgProducts').jqGrid({ 
     url: '/Home/GridSampleData/', // url from wich data should be requested 
     datatype: 'json',    // type of data 
     mtype: 'GET',     // url access method type 
     colNames: ['userid', 'username', 'email', 'contact', 'password'], 
     colModel: [     // columns model 
      { name: 'userId', index: 'userId', align: 'left', 
       editable: false }, 
      { name: 'username', index: 'username', align: 'left', 
       editable: true, edittype: 'text', 
       editoptions: { maxlength: 20 }, 
       editrules: { required: true} }, 
      { name: 'email', index: 'email', align: 'left', editable: true, 
       edittype: 'text', editoptions: { maxlength: 50 }, 
       editrules: { required: true} }, 
      { name: 'contact', index: 'contact', align: 'left', 
       editable: true, edittype: 'text', 
       editoptions: { maxlength: 20 }, editrules: { required: true} }, 
      { name: 'password', index: 'password', align: 'left', 
       editable: true, edittype: 'password', 
       editoptions: { maxlength: 20 }, 
       editrules: { required: true} } 
     ], 
     pager: $('#jqgpProducts'), // pager for grid 
     rowNum: 5,     // number of rows per page 
     sortname: 'userId',  // initial sorting column 
     sortorder: 'asc',   // initial sorting direction 
     viewrecords: true,   // we want to display total records count 
     width: '600',    // grid width 
     height: 'auto'    // grid height 
    }); 
}); 

उत्तर

20

"सच toppager" शामिल है। यह वही करता है जो आप चाहते हैं: "जब यह विकल्प सक्षम होता है तो कैप्शन के नीचे ग्रिड के शीर्ष पर एक पेजर तत्व रखें (यदि उपलब्ध हो)। यदि कोई अन्य पेजर परिभाषित किया गया है तो दोनों समन्वय कर सकते हैं और सिंक में रीफ्रेश हो सकते हैं।"

विकल्पों की पूर्ण सूची आप http://www.trirand.com/jqgridwiki/doku.php?id=wiki:options

+0

धन्यवाद ओलेग देखा था, मुझे एक टन –

+1

@Allen बाहर की मदद की: आप का स्वागत है! यदि आप पेजर के अधिक अनुकूलन चाहते हैं तो मेरा दूसरा जवाब http://stackoverflow.com/questions/3552855/add-toolbar-in-the-bottom-of-the-header-using-jqgrid/3557663#3557663 भी दिलचस्प हो सकता है तुम्हारे लिए। – Oleg

+0

@ ओलेग - क्या यह इसे शीर्ष केंद्र या शीर्ष बाईं ओर रखता है ?? – leora

0

पर पा सकते हैं यह 4 साल देर हो चुकी है, लेकिन मैं कुछ इस तरह, टेम्पलेट विकल्प

template: '<div>' + 
      '<div class="jqgrid-pagination"></div>' + 
      '<table></table>' + 
      '<div class="jqgrid-pagination"></div>' +    
      '</div>',