toggle - jqgrid how to expand/collapse subgrid when click a row

I need to click a row, and ifthe subgrid is collapsed, then expand it.the subgrid is expanded, then collapse it.I found the question is here, but @Oleg sugesstion didn't work in my project. I have debuged it and found the "onSelectRow" will be executed twice. for example, onSelectRow: function (row_id) { alert("hello"); },It will get two alert. So, if I write this: onSelectRow: function (row_id) { $("#grd").toggleSubGridRow(row_id); },it will expand and collapse,(actually, I can't see the process, I find...Read more

jqGrid how to collapse row when clicking on other row

In a main grid, when I click on one row, it become 'highlighted' and the seven subgrids are showed.Here is an example where first row is selected, and near to be edited (work in progress) :Now, if I click on second row of the main grid, the first is hidden and the second selected. I click after on edit button and a warning appears : no selected row ! If I click again on the second row, it become unselected, and again I click for selecting and editing, that runs fine ! So I presume that my code for switching between collapsed and expanded status...Read more

jqgrid client sorting server paging gotcha.....using the latest version

Client side sorting works fine when I set loadonce to true. I tried doing that during the onSortCol event but the pager is getting disabled. Setting 'datatype' to 'local' isnt enabling client side sorting. The datatype is initially 'json', and the url points to an asmx webmethod. I planned on using the onPaging method as described in numerous stack overflow posts to change the datatype to json to again enable server side paging.i.e. Setting 'datatype' to 'local' isnt enabling client side sorting, but setting 'loadonce' to true is.Is there a wa...Read more

html escape characters - jqgrid autoencode=true encode postdata

I'm trying to fix XSS vulnerabilities across my web application and I'm stuck with jqGrid.I activated 'autoencode' for all my grids and the documentation says : "When set to true encodes (html encode) the incoming (from server) and posted data (from editing modules).".My problem is that I don't understand why posted data are encoded. This way I'm getting html escaped text in my database. So this database is no more readable by an other application (or it has to decode all texts), and in addition database search doesn't work any more.So, is it p...Read more

JQGrid datatype as Ajax function not getting called

JQGrid datatype as Ajax function not getting called. once I tried to debug using firebug, found out that those lines are not executed. Please let me know the issue with my code.jQuery("#list").jqGrid({ //url:'example.xml', datatype: function() { $.ajax({ url: "example.xml", data: "{}", dataType: "xml", mtype: "GET", complete: function(jsondata, stat) { alert((jsondata.responseText)); if (stat == "success") { alert("ew"); ...Read more

JQgrid checkbox onclick update database

I have a checkbox column in my JqGrid which get loaded from DB, so it is either checked or not checked when it is loaded.What i want is : If checkbox is being checked or uncheked by user i want to update DB in at same. I dont want user to press enter or anything. only 1 click and send action to DBname: 'Aktiv', index: 'Aktiv', width: 100, edittype: 'checkbox', align: 'center',formatter: "checkbox", editable: true, formatoptions: {disabled : false}...Read more

jqGrid grouping feature disappear when run addRowData

The jqGrid's website has following code example about how to use grouping feature, it works very well. $(document).ready(function(){ var mydata = [ {id:"1",invdate:"2010-05-24",name:"test",note:"note",tax:"10.00",total:"2111.00"} , {id:"2",invdate:"2010-05-25",name:"test2",note:"note2",tax:"20.00",total:"320.00"}, .... ]; $("#list48").jqGrid({ data: mydata, datatype: "local", height: 'auto', rowNum: 30, rowList: [10,20,30], ...Read more

How can I add a checkbox into a jQgrid header

Each jQgrid row has multiple checkboxes, so I cannot use (just) the multiselect.This is how the column is setup... { name: 'ColName', label: '', width: 50, editable: true, sortable: false, edittype: "checkbox", formatter: 'checkbox', formatoptions: { disabled:false}, index:"my_checkbox", editoptions: {value:"Yes":"No"} }When I click the checkbox in the header, the header is redrawn without the check. I can capture the event, but cannot display the check to the user.So my question would be, how can I get a checkbox to operate normally insid...Read more

jqgrid is not displaying in html page

it is my page code in this page jqgrid is not displaying output.please why this error will cal you send me the code with explain.. <link rel="stylesheet" href="css/boilerplate.css" /> <link rel="stylesheet" href="css/global.css" /> <link rel="stylesheet" href="css/splash.css" /> <link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="css/redmond/jquery-ui.css"> <link rel="stylesheet" href="css/redmond/jquery.ui.theme.css"> <link rel="stylesheet" href="css...Read more

filtering - jqgrid apply filter after reload?

Am using jqgrid, loading data once, sorting and filtering locally and doing a refresh after each update/insert/delete. It works fine, besides that if I am using a filter (on top of grid), the filter remains the same after refresh, but the filter is not re-applied on the newly loaded data. I have tried to call mygrid[0].triggerToolbar() after reloading grid with trigger('reloadGrid'), but there is no effect.Thanks for any help or pointers :-)Code below: var lastsel; var mygrid; var currentLang; //setup grid with columns, properties, events funct...Read more

row - jqgrid did not display any field on edit or add form

I built a very basic jqgrid table. It displays results from the url I provide without problems. If I click on add row or on edit row icon, an empty windows appears without any fields to fill.Here is my code:$('#mygrid').jqGrid({ colMenu: true, url: 'someurl.php', datatype:'json', colNames:['NUMB','ACCNAME','MEMO','TOTAL','APR','MAY','JUN','JUL','AUG','SEP','OCT','NOV','DEC','JAN','FEB','MAR'], colModel: [ { name: "ACCOUNT_NUMBER", width:60}, { name: "ACCNAME", editable: "true"}, ...Read more

Iterate through jqGrid update every row for a column

I wish to iterate through jqGrid, and for a given column (ie: the second) I wish to insert a value. How do you find the first data row? The documentation warns to not use getRowData if updating row or cell data.This is what I'm using, but it seems clumsy:function loadCompleted() { var $grid = jQuery("#jqGrid"), rows = $grid[0].rows; for (var i = 1; i < rows.length; i++) { var row = rows[i]; var id = row.cells[0].innerHTML; $(row.cells[1]).html("<a href='#' onclick='deleteApp(" + id + "); return false;'>Delete...Read more

jqGrid getRowData returns empty object

when I call $('#myId').jqGrid('getRowData', index), i just get back empty object. If I call $('#softwareCartGrid').jqGrid('getRowData')[index] I get the row object I expect. Under what circumstances does $('#myId').jqGrid('getRowData', index) fail in this manner? I've hacked a workaroud to accomodate this, but, it's driving me crazy....Read more

Free JqGrid: Sort DESC on first click

I'm using Free JqGrid and I have an issue with sorting the columns. I use a remote data in my setup. I want the grid to load default without no sorting at all, but when the user clicks any of the sortable columns I want it to sort DESC first instead of ASC (which it will always do). I'd also like the (default) sorting icons to point in this direction.Can anyone point me in the right direction?...Read more