jqgrid

Finding current page number in jqGrid

爱⌒轻易说出口 提交于 2020-01-23 04:21:15
问题 How can I find the current page number in jqGrid (using jQuery of course). Also how do I know how many pages are there in total. 回答1: This should do it: $("#sp_1").text(); // total pages $(".ui-pg-input").val(); // current page Edit: I found a better way in the docs for the current page but I didn't see anything for the total page count. (Click Manipulating -> Get Methods) $('#your_grid').getGridParam('page'); // current page 回答2: this is an old question but it might help someone, $("#"

jqGrid添加详细按钮,单击弹出窗体

时光怂恿深爱的人放手 提交于 2020-01-22 18:30:39
代码如下: @using WebMap.Framework.UI; @using WebMap.Admin.Models; @using WebMap.Core; @using WebMap.Core.Infrastructure; @{ ViewBag.Title = "贷款申请管理"; var defaultSettins = EngineContext.Current.Resolve<WebMap.Domain.Common.AdminAreaSettings>(); } @section HeadSection { <link rel="stylesheet" href="/Content/v1/jquery-ui.css" /> <link rel="stylesheet" href="/Content/v1/ui.jqgrid.css" /> <link rel="stylesheet" href="/Content/v1/datepicker.css" /> <link rel="stylesheet" href="/Content/v1/bootstrap-timepicker.css" /> <link rel="stylesheet" href="/Content/v1/daterangepicker.css" /> <link rel="stylesheet"

Jquery JQGrid breaks when contentType=application/json?

安稳与你 提交于 2020-01-22 16:35:28
问题 I've had to use $.ajaxSetup() to globally change the contentType to application/json $.ajaxSetup({ contentType: "application/json; charset=utf-8" }); (See this question for why I had to use application/json ASPNET MVC - Why is ModelState.IsValid false "The x field is required" when that field does have a value?) But this breaks the jquery jqrid with this error: Invalid JSON primitive: _search The POST data it is trying to send is: _search=false&nd=1274042681880&rows=20&page=1&sidx=&sord=asc

jqGrid: how to change cell padding

眉间皱痕 提交于 2020-01-22 12:38:46
问题 I'm using jqGrid3.6.5 on google hosted jQueryUI1.8.2 and jQuery1.4.2 I want to change the cell padding of a jqGrid. For testing purposes I want to set it to 10px all around each cell. The only option I've come across while googling is the following: add padding with CSS. eg. #grid-id td, #grid-id th { padding:10px; } set cellLayout option to 21 (paddingleft + paddingright + borderleft) When I have no set width on any of the columns in my colModel, this works like expected. Though when I

jqGrid showCol/hideCol not working after sorting

*爱你&永不变心* 提交于 2020-01-22 02:50:34
问题 The below given code illustrates what I have done fro hide/show. It does work on load but wouldn't work after sorting grid.jqGrid({ url: "processing.php", datatype: "json", mtype: "POST", postData: { "sessionTicket": "<?php echo $sessionTicket; ?>" }, colNames: ["Details", "Name", "Address", "Date"], colModel: [ { id: "details", name: "Details", width: 200, classes: 'pointer wrap', formatter: function matterFormatter(cellvalue, options, rowObject) { if (rowObject.properties == undefined) {

JqGrid addJSONData + ASP.NET 2.0 WS

别说谁变了你拦得住时间么 提交于 2020-01-21 05:45:48
问题 I am a bit lost. I've tried to implement a solution based on JqGrid and tried to use function as datatype. I've setted all by the book I guess, I get WS invoked and get JSON back, I got succes on clientside in ajax call and I "bind" jqGrid using addJSONData but grid remains empty. I do not have any clue now... other "local" samples on same pages works without a problem (jsonstring ...) My WS method looks like: [WebMethod] [ScriptMethod(ResponseFormat = ResponseFormat.Json)] public string

JqGrid addJSONData + ASP.NET 2.0 WS

 ̄綄美尐妖づ 提交于 2020-01-21 05:45:14
问题 I am a bit lost. I've tried to implement a solution based on JqGrid and tried to use function as datatype. I've setted all by the book I guess, I get WS invoked and get JSON back, I got succes on clientside in ajax call and I "bind" jqGrid using addJSONData but grid remains empty. I do not have any clue now... other "local" samples on same pages works without a problem (jsonstring ...) My WS method looks like: [WebMethod] [ScriptMethod(ResponseFormat = ResponseFormat.Json)] public string

Adding jqGrid Custom Navigation to Top Toolbar

▼魔方 西西 提交于 2020-01-19 05:05:42
问题 Is it possible to add navigation items to the "top pager" in a jqGrid? And if so, what's the syntax for doing so? I have an HTML snippet on my page that looks like this <table id="mygrid"> </table> <div id="mygrid_pager"></div> And then an jqGrid initialization that looks something like this $('#mygrid').jqGrid({ ..., //full config string removed for brevity, pager:jQuery('#mygrid'), toppager:true }); $('#mygrid').jqGrid('navGrid', '#mygrid_pager'),{ 'add':false, 'del':false, 'edit':false,

Adding jqGrid Custom Navigation to Top Toolbar

我的未来我决定 提交于 2020-01-19 05:05:30
问题 Is it possible to add navigation items to the "top pager" in a jqGrid? And if so, what's the syntax for doing so? I have an HTML snippet on my page that looks like this <table id="mygrid"> </table> <div id="mygrid_pager"></div> And then an jqGrid initialization that looks something like this $('#mygrid').jqGrid({ ..., //full config string removed for brevity, pager:jQuery('#mygrid'), toppager:true }); $('#mygrid').jqGrid('navGrid', '#mygrid_pager'),{ 'add':false, 'del':false, 'edit':false,

Validation before submitting the Search form generated using filterGrid in JQGrid

拥有回忆 提交于 2020-01-19 04:06:13
问题 I have a search form I generated using the filterGrid option in JqGrid. I want to add a JavaScript logic which is invoked before I submit the Search form. I have added a method which is invoked by the beforeSubmit property for the filterGrid. It goes into the method before submitting, but always submits the form regardless of the value returned. I would like the form to not submit if the javascript returns false. Have any of you guys implemented anything like this before. Or is there any othe