jquery - Textbox for rowList instead of select in jqGrid pager -



jquery - Textbox for rowList instead of select in jqGrid pager -

is possible have textbox , button specify page size instead of having select options.

i want pager below

user can come in page number in first text box , refresh grid when clicking on "go" button , user can alter page size editing sec text box , clicking on "change" grid needs refreshed updated total number of pages,page size etc..

thanks in advance!!

everything possible! the demo demonstrates 1 of possible implementation. uses external input control:

in same way can move controls pager/pagers, can forcefulness click on "change" button on pressing enter key , on. wanted demonstrate how requirements implemented. used both toppager , sec pager @ bottom on demo demonstrates approach works in case too.

the code used in demo following:

var getpagerselectors = function () { homecoming $("#list").closest(".ui-jqgrid").find(">.ui-jqgrid-view>.ui-jqgrid-toppager,>.ui-jqgrid-pager").find(".ui-pg-selbox"); }; $("#setrownum").button().click(function () { var newrownum = parseint($("#newrownum").val(), 10); if (newrownum > 0) { var $selects = getpagerselectors(); var $firstoption = $selects.find("option:nth-child(1)"); $firstoption.text(newrownum); $firstoption.val(newrownum); $selects.first().val(newrownum); $selects.first().trigger("change"); } }); getpagerselectors().hide();

if 1 removed lastly line (getpagerselectors().hide();) 1 see alter value of first alternative in <select> used jqgrid choosing page size, set alternative selected , trigger "change" event in first pager. it's all.

updated: one more demo uses insertafter move controls used entering new page size. results looks below

i used next css styles

class="lang-css prettyprint-override">.ui-jqgrid .ui-jqgrid-pager, .ui-jqgrid .ui-jqgrid-toppager { height: auto !important; } .ui-jqgrid .ui-pg-table { padding-bottom: 0; }

to improve little height of pager after adding new components.

jquery jqgrid pager

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -