Unable to load a Datatable on click of a button - datatables

I am trying to load a datatable on click of a button outside the datatable.
below is my piece of code
$('#buttonToLoadDatatable').on('click', function() {
$.ajax({
type: "GET",
url:"../fhParser/fhParser/downloadAndParseResume/v1",
}).done(function (result) {
var table = $('#example').DataTable( {
"sDom": "<'dt-toolbar'<'col-xs-12 col-sm-6'f><'col-sm-6 col-xs-
12 hidden-xs'l>r>"+
"t"+
"<'dt-toolbar-footer'<'col-sm-6 col-xs-12 hidden-xs'i><'col-xs-12 col-sm-6'p>>",
"oLanguage": {
"sSearch": '<span class="input-group-addon"><i
class="glyphicon glyphicon-search"></i></span>'
},
"bDestroy": true,
"data":result,
"iDisplayLength": 15,
/**this portion was because I have a collapsible rows**/
"columns": [
{
"class": 'details-control',
"orderable": false,
"data": null,
"defaultContent": ''
},
{ "data":"email" }
],
rowCallback: function (row, data) {},
filter: false,
info: false,
ordering: false,
processing: true,
retrieve: true,
"fnDrawCallback": function( oSettings ) {
runAllCharts()
}
// rowCallback: function (row, data) {}
} );
console.log( result );
}).fail(function (jqXHR, textStatus, errorThrown) {
});
});
When I print the value in the browser console, it comes correctly as
{"email": "triedandtest#gmail.com"}, but it does not display in the datatable
There is no error also in the console or at the backend

Can you replace your code to
$('#buttonToLoadDatatable').on('click', function() {
$.ajax({
type: "GET",
url:"../fhParser/fhParser/downloadAndParseResume/v1",
}).done(function (result) {
var table = $('#example').DataTable( {
"sDom": "<'dt-toolbar'<'col-xs-12 col-sm-6'f><'col-sm-6 col-xs-
12 hidden-xs'l>r>"+
"t"+
"<'dt-toolbar-footer'<'col-sm-6 col-xs-12 hidden-xs'i><'col-xs-12 col-sm-6'p>>",
"oLanguage": {
"sSearch": '<span class="input-group-addon"><i
class="glyphicon glyphicon-search"></i></span>'
},
"bDestroy": true,
"data":result.data,
"iDisplayLength": 15,
/**this portion was because I have a collapsible rows**/
"columns": [
{
"class": 'details-control',
"orderable": false,
"data": null,
"defaultContent": ''
},
{ "data":"email" }
],
rowCallback: function (row, data) {},
filter: false,
info: false,
ordering: false,
processing: true,
retrieve: true,
"fnDrawCallback": function( oSettings ) {
runAllCharts()
}
// rowCallback: function (row, data) {}
} );
console.log( result );
}).fail(function (jqXHR, textStatus, errorThrown) {
});
});
and check if that works
FYI changed "data":result, to "data":result.data,

Related

Search Builder extension of DataTables does not save values

I am using the SearchBuilder extension to filter data.
Because I am also using sever-side processing, I force a search only when the user presses the enter key, like example.
But when I click button ">" to add new criteria, the previous value is empty.
Any suggestion for me?
Here my code:
I use search:{true} to force search only search only user press enter
$table = $(`#${_options.table.id}`).DataTable({
dom: 'Blfrtip',
search: {
return: true
},
"processing": true, // for show progress bar
"serverSide": true,
"filter": true,
"pageLength": 2,
"pagingType": "full_numbers",
"ajax": {
"url": _options.table.urls.load,
"type": "POST",
"datatype": "json"
},
"ordering": true,
"order": [[2,'asc']],
//"order": [[0, 'asc'], [1, 'asc']]
"columns":[
{
"data": null,
"orderable": false,
"searchable": false,
"className": "text-center",
render: function (data, type, row, meta) {
let html = `<div class="icheck-primary input-group" style="display:block;">
<input type="checkbox" id="example1_${meta.row}">
<label for="example1_${meta.row}"></label>
</div>`;
return html;
},
searchBuilderType: 'html'
},
{
"data": "id",
"name": "Mã số",
"autoWidth": true,
"visible": false,
"searchable": false
},
{
"data": "title",
"name": "Tên danh mục",
"autoWidth": true,
searchBuilderType: 'string'
},
{
"data": "created",
"name": "Ngày tạo",
"autoWidth": true,
render: function (data, type, row, meta) {
return new Date(data).toLocaleDateString("vi-VN");
}
},
{
"data": "modified",
"name": "Ngày chỉnh sữa",
"autoWidth": true,
render: function (data, type, row, meta) {
return new Date(data).toLocaleDateString("vi-VN");
}
},
{
"data": "active",
"name": "Hoạt động",
"autoWidth": true,
"className": "text-center",
"width": "10%",
render: function (data, type, row, meta) {
let html = `<div class="icheck-primary input-group" style="display:block;">
<input disabled type="checkbox" ${data ? 'checked' : ''} id="example1_active_${meta.row}" name="terms">
<label for="example1_active_${meta.row}"></label>
</div>`;
return html;
}
},
{
"orderable": false,
"width": "15%",
"className": "text-center",
"data": null,
"render": function (data, type, row, meta) {
return `<a class="btn btn-info btn-sm" onclick="Edit('${row.id}', '${row.title}');" href="#">Edit</a> <a href="#" class="btn btn-danger btn-sm" onclick="Delete('${row.id}', '${row.title}');" >Delete</a>`;
}
}
],
"createdRow": function (row, data, dataIndex) {
let checkbox = $(row).children('td').first().find('input[type="checkbox"]');
let headerCheckbox = $($table.column().header()).find('input[type=checkbox]');
headerCheckbox.prop('checked', false);
checkbox.on('change', { rowIndex: dataIndex }, function (e) {
let checked = $(this).prop('checked');
let headerCheckbox = $($table.column().header()).find('input[type=checkbox]');
let tableId = $table.table().node().id;
let deletebutton = $(`button[aria-controls = ${tableId}][name=delete]`);
let rowIdx = e.data.rowIndex;
if (checked) {
$table.rows(rowIdx).select();
$count++;
if ($count == $table.rows().count()) {
headerCheckbox.prop('checked', true);
}
deletebutton.attr('disabled', false);
}
else {
$table.rows(rowIdx).deselect();
$count--;
if ($count == 0) {
deletebutton.attr('disabled', true);
}
headerCheckbox.prop('checked', false);
}
});
},
"initComplete": function (settings, json) {
// Add custom button into table wrapper
$table.buttons().container().appendTo(`#${_options.table.id}_wrapper .col-md-6:eq(0)`);
//Select all bycheckbox header
let headerCheckbox = $($table.column().header()).find('input[type=checkbox]');
headerCheckbox.on('change', { settings: settings }, function (e) {
let checked = $(this).prop('checked');
for (let i = 0; i < $table.rows().count(); i++) {
$($table.rows(i).column().nodes()[i]).find('input[type="checkbox"]').prop('checked', checked);
}
let deletebutton = $(`button[aria-controls = ${_options.table.id}][name=delete]`).attr('disabled', !checked);
(checked) ? $table.rows().select() : $table.rows().deselect();
});
},
"responsive": true,
"lengthChange": false,
"autoWidth": false,
language: {
searchBuilder: {
button: {
0: 'Criteria',
1: 'Criteria (one selected)',
_: 'Criteria (%d)'
}
}
},
"buttons": [
{
text: `<i class="fas fa-plus"> New</i>`,
className: 'btn btn-primary form-group',
attr: {
'name': 'new',
'style': 'background: #007bff !important; border-color: #007bff !important'
},
action: function (e, dt, node, config) {
ajaxFormAction(_options.modal.selector, _options.modal.id, 'Create new category', '/Admin/Category/Create', true, function (e) {
$table.draw();
});
}
},
{
text: `<i class="fas fa-trash"> Delete</i>`,
className: 'btn btn-danger form-group',
attr: {
'name': 'delete',
"disabled": true
},
action: function (e, dt, node, config) {
let ids = [];
let rows = $table.rows({ selected: true }).every(function (rowIdx, tableLoop, rowLoop) {
ids.push(this.data().id);
});
ids = ids.join(',');
ajaxDelete(ids, null, _options.table.urls.delete, function (e) {
$table.draw();
});
}
},
{
text: 'Filter',
className: 'btn btn-default form-group',
extend: 'searchBuilder'
}
]
})
$('<input id="example1_column" type="text" class="form-control form-control-sm" placeholder="aaaa" />').insertBefore($("#example1_filter input"));
return $table

DataTable doesn't show data

I am trying to use Datatable and I have an issue with Datatable populating data in my .net core project.When the page is loaded, DataTable records are empty.According to the picture below:
Controller:
public IActionResult ShowCategory()
{
return View();
}
public IActionResult CategoryList()
{
try
{
var draw = HttpContext.Request.Form["draw"].FirstOrDefault();
// Skiping number of Rows count
var start = Request.Form["start"].FirstOrDefault();
// Paging Length 10,20
var length = Request.Form["length"].FirstOrDefault();
// Sort Column Name
var sortColumn = Request.Form["columns[" + Request.Form["order[0][column]"].FirstOrDefault() + "][name]"].FirstOrDefault();
// Sort Column Direction ( asc ,desc)
var sortColumnDirection = Request.Form["order[0][dir]"].FirstOrDefault();
// Search Value from (Search box)
var searchValue = Request.Form["search[value]"].FirstOrDefault()
var data = _categoryRepository.GetCategories();
return Json(new { draw = 1, recordsFiltered = 4, recordsTotal = 4, data = data });
}
catch(Exception ex)
{
throw;
}
}
Due to a problem with the code, I have now passed the draw and ... to View as a hardcode.
GetCategories() method:
public List<CategoryViewModel> GetCategories()
{
var query = _CategoryRepo.GetAll();
var q = query.Select(s => new CategoryViewModel
{
Id = s.Id,
CaregoryParentId = s.CaregoryParentId,
Priority = s.Priority,
Title = s.Title
}).ToList();
return q;
}
view:
#{
Layout = null;
}
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<link href="~/css/admin/bootstrap.min.css" rel="stylesheet" />
<link href="https://cdn.datatables.net/1.10.15/css/dataTables.bootstrap.min.css" rel="stylesheet" />
<link href="https://cdn.datatables.net/responsive/2.1.1/css/responsive.bootstrap.min.css" rel="stylesheet" />
<script src="https://cdn.datatables.net/1.10.15/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.10.15/js/dataTables.bootstrap4.min.js "></script>
<div class="container">
<br />
<div style="width:90%; margin:0 auto;">
<table id="example" class="table table-striped table-bordered dt-responsive nowrap" width="100%" cellspacing="0">
<thead>
<tr>
<th>Id</th>
<th>Title</th>
<th>CaregoryParentId</th>
<th>Priority</th>
<th>Edit</th>
<th>Delete</th>
</tr>
</thead>
</table>
</div>
</div>
<script>
$(document).ready(function ()
{
$("#example").DataTable({
"processing": true, // for show progress bar
"serverSide": true, // for process server side
"filter": true, // this is for disable filter (search box)
"orderMulti": false, // for disable multiple column at once
"ajax": {
"url": "/Admin/Category/CategoryList",
"type": "POST",
"datatype": "json"
//"success": function (data) {
// alert(JSON.stringify(data));
//}
},
"columnDefs":
[{
"targets": [0],
"visible": false,
"searchable": false
}],
{ "data": "Id", "name": "Id", "autoWidth": true },
{ "data": "Title", "name": "Title", "autoWidth": true },
{ "data": "CaregoryParentId", "name": "CaregoryParentId", "autoWidth": true },
{ "data": "Priority", "name": "Priority", "autoWidth": true },
{
"render": function (data, type, full, meta)
{ return '<a class="btn btn-info" href="/DemoGrid/Edit/' + full.CustomerID + '">Edit</a>'; }
},
{
data: null, render: function (data, type, row)
{
return "<a href='#' class='btn btn-danger' onclick=DeleteData('" + row.CustomerID + "'); >Delete</a>";
}
},
]
});
});
function DeleteData(CustomerID)
{
if (confirm("Are you sure you want to delete ...?"))
{
Delete(CustomerID);
}
else
{
return false;
}
}
function Delete(CustomerID)
{
var url = '#Url.Content("~/")' + "DemoGrid/Delete";
$.post(url, { ID: CustomerID }, function (data)
{
if (data)
{
oTable = $('#example').DataTable();
oTable.draw();
}
else
{
alert("Something Went Wrong!");
}
});
}
</script>
when I debug, I receive data in Ajax success function, but it is not shown in the table.
can anybody help me?
Thanks a lot
when I debug, I receive data in Ajax success function, but it is not
shown in the table.
From the result above we can see, server return serializes JSON with camel case names by default.
Id => id
Title => title
CaregoryParentId => caregoryParentId
Priority => priority
But in your script, "data" is set as "Id".
Solution
Use the codes below to avoid camel case names by default.
services.AddControllersWithViews().AddJsonOptions(opts => opts.JsonSerializerOptions.PropertyNamingPolicy = null);
Codes of JS
$(document).ready(function ()
{
$("#example").DataTable({
"processing": true, // for show progress bar
"serverSide": true, // for process server side
"filter": true, // this is for disable filter (search box)
"orderMulti": false, // for disable multiple column at once
"ajax": {
"url": "/Admin/Category/CategoryList",
"type": "POST",
"datatype": "json",
//"success": function (data) {
// alert(JSON.stringify(data));
//}
},
"columnDefs":
[{
"targets": [0],
"visible": false,
"searchable": false
}],
"columns": [
{ "data": "Id", "name": "Id", "autoWidth": true },
{ "data": "Title", "name": "Title", "autoWidth": true },
{ "data": "CaregoryParentId", "name": "CaregoryParentId", "autoWidth": true },
{ "data": "Priority", "name": "Priority", "autoWidth": true },
{
"render": function (data, type, full, meta) { return '<a class="btn btn-info" href="/DemoGrid/Edit/' + full.CustomerID + '">Edit</a>'; }
},
{
data: null, render: function (data, type, row) {
return "<a href='#' class='btn btn-danger' onclick=DeleteData('" + row.CustomerID + "'); >Delete</a>";
}
}
]
});
});
Test of result

How to get checkbox value from Datatable?

I want to get the selected checkbox value from the data table, in my table, I have two columns and the first one is for the checkbox and the second one is for display values.
Here is just returning a checkbox. How can we know that there is a click that happens?
Help me.
Here is the code
function BindColumSelectTable(DataExchangeList) {
debugger
$('#columnSelectTable').DataTable({
"data": DataExchangeList,
"destroy": true,
"columns": [
{
data: 'check', render: function (data, type, row) {
debugger;
return '<input type="checkbox"/>'
}
},
{ data:"FieldCaption" },
],
"columnDefs": [
{
orderable: false,
className: "select-checkbox",
targets:0
},
{ className:"tabletdAdjust","targets":[1]}
],
});}
I'm using jquery data table
function BindColumSelectTable(DataExchangeList) {
$('#columnSelectTable').DataTable({
"data": DataExchangeList,
"destroy": true,
"columns": [
{
data: 'check', render: function (data, type, row) {
var checkbox = $("<input/>",{
"type": "checkbox"
});
if(data === "1"){
checkbox.attr("checked", "checked");
checkbox.addClass("checked");
}else{
checkbox.addClass("unchecked");
}
return checkbox.prop("outerHTML")
}
},
{ data:"FieldCaption" },
],
"columnDefs": [
{
orderable: false,
className: "select-checkbox",
targets:0
},
{ className:"tabletdAdjust","targets":[1]}
],
});}
Try this
Here is the answer I use onclick function for each click it will trigger the function
function BindColumSelectTable(DataExchangeList) {
debugger
$('#columnSelectTable').DataTable({
"data": DataExchangeList,
"destroy": true,
"columns": [
{
data: 'ColumnCheck', render: function (data, type, row) {
debugger;
return '<input type="checkbox" onclick="ColumnCheck(this)"/>'
}
},
{ data:"FieldCaption" },
],
"columnDefs": [
{
orderable: false,
className: "select-checkbox",
targets:0
},
{ className:"tabletdAdjust","targets":[1]}
],
});
}
the above code is the same i used in the question only one thing i added is an onclick function
and the onclick function is
function ColumnCheck(thisObj) {
debugger;
var dataExchangeCheckColumnVM = $('#columnSelectTable').DataTable().row($(thisObj).parents('tr')).data();
var dataExchangeCheckColumnList = $('#columnSelectTable').DataTable().rows().data();
for (var i = 0; i < dataExchangeCheckColumnList.length; i++) {
if (dataExchangeCheckColumnList[i].FieldCaption !== null) {
if (dataExchangeCheckColumnList[i].FieldCaption === dataExchangeCheckColumnVM.FieldCaption) {
dataExchangeCheckColumnList[i].ColumnCheck = thisObj.checked;
}
}
}
_dataExchangeColumnList = dataExchangeCheckColumnList;
}
so i used an property **ColumnCheck ** it is boolean variable. on each iteration it will added a true value if check box is checked

getting devextreme dataGrid to work with webpack

I am just trying to get a simple demo app working using webpack and devextreme components. I built the app first without webpack and it all worked fine. I am now trying to refactor it to use webpack. I can't get the dataGrid page to work I am just getting a console error .dxDataGrid is not a function. If anyone can see where I have gone wrong any ideas would be great.
var $ = require('jquery');
var ko = require('knockout');
require('devextreme/integration/knockout');
require('devextreme/ui/data_grid');
require('devextreme/ui/form');
require('devextreme/ui/text_box');
require('devextreme/ui/button');
require('devextreme/ui/check_box');
require('devextreme/ui/popup');
var AspNetData = require('devextreme-aspnet-data/js/dx.aspnet.data');
$(function () {
var url = CONST_URL + 'Login/';
$("#userGrid").dxDataGrid({
showColumnLines: false,
showRowLines: true,
rowAlternationEnabled: true,
columnHidingEnabled: true,
showBorders: true,
dataSource: AspNetData.createStore({
key: "id",
loadUrl: url + "GetUsers",
insertUrl: url + "UpsertUser",
updateUrl: url + "UpsertUser",
deleteUrl: url + "DeleteUser"
}),
columnChooser: {
//enabled: true,
//mode: "select"
},
paging: {
pageSize: 5
},
pager: {
showPageSizeSelector: true,
//allowedPageSizes: [5, 10, 15],
showInfo: true
},
editing: {
allowUpdating: true,
mode: "form",
allowAdding: true,
allowDeleting: true
},
columns: [
{
dataField: "id",
caption: "User ID",
formItem: {
visible: false
},
hidingPriority: 1
},
{
dataField: "username",
caption: "Username",
validationRules: [{
type: "required",
message: "Username"
}, {
type: 'pattern',
pattern: /^([a-zA-Z0-9_.+-])+\#(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/,
message: 'Please supply a valid email address.'
}],
formItem: {
visible: true
},
hidingPriority: 3
},
{
dataField: "password",
caption: "password",
mode: "password",
validationRules: [{
type: "required",
message: "Password",
}, {
type: "stringLength",
min: 8,
message: "Your password must have at least 8 characters."
}],
visible: false,
formItem: {
visible: true
}
},
{
dataField: "date_created",
caption: "Date Created",
formItem: {
visible: false
},
hidingPriority: 2
},
{
dataField: "is_locked",
caption: "User Locked Out",
hidingPriority: 0
}],
onEditorPreparing: function (e) {
if (e.dataField === "password") {
e.editorOptions.mode = 'password';
}
if (e.parentType === "dataRow" && e.dataField === "username") {
setTimeout(function () { $(e.editorElement).dxTextBox("focus") }, 100);
}
},
onToolbarPreparing: function (e) {
var dataGrid = e.component;
e.toolbarOptions.items.unshift({
location: "before",
template: function () {
return $("<div/>")
.append(
$("<h2 />")
.text("User List")
);
}
});
},
onEditingStart: function (e) {
isUpdateCanceled = false;
e.component.columnOption("date_created", "allowEditing", false);
e.component.columnOption("id", "allowEditing", false);
},
onInitNewRow: function (e) {
isUpdateCanceled = false;
e.component.columnOption("date_created", "allowEditing", false);
e.component.columnOption("id", "allowEditing", false);
e.component.columnOption("is_locked", "allowEditing", false);
},
onContentReady: function (e) {
var saveButton = $(".dx-button[aria-label='Save']");
if (saveButton.length > 0)
saveButton.click(function (event) {
console.log(e.component);
if (!isUpdateCanceled) {
upsert(e.component);
event.stopPropagation();
}
});
}
});
});
Devexpress team gave me the solution. I thought I would post it here in case anyone else has the same issue. I was missing the jquery intergration.
require('devextreme/integration/jquery');

Event that is taking place after inline edit

I have jqgrid, which sends row's data to another view (MVC4) when row is selected. But when I edit row's info (I'm using inline edit) this view doesn't changed. And I can't find event that is taking place after inline edit. This is js, what should I change to change my view after row editing
$(function () {
$("#GridTable").jqGrid({
url: "/Goods/GoodsList",
editurl: "/Goods/Edit",
datatype: 'json',
mtype: 'Get',
colNames: ['GoodId', 'Имя', 'Цена'],
colModel: [
{ key: true, hidden: true, name: 'GoodId', index: 'GoodId', editable: true },
{
key: false, name: 'GoodName', index: 'GoodName', editable: true, sortable: true,
editrules: {
required: true, custom: true, custom_func: notATag
}
},
{
key: false, name: 'Price', index: 'Price', editable: true, sortable: true, formatter: numFormat,
unformat: numUnformat,
//sorttype: 'float',
editrules: { required: true, custom: true, custom_func: figureValid}
}, ],
pager: jQuery('#pager'),
rowNum: 10,
rowList: [10, 25, 50, 100],
height: '100%',
viewrecords: true,
caption: 'Список товаров',
sortable: true,
emptyrecords: 'No records to display',
cellsubmit : 'remote',
jsonReader: {
root: "rows",
page: "page",
total: "total",
records: "records",
repeatitems: false,
Id: "0"
},
//to get good's full view when row is selected
onSelectRow:
function () {
var myGrid = $('#GridTable'),
selRowId = myGrid.jqGrid('getGridParam', 'selrow'),
celValue = myGrid.jqGrid('getCell', selRowId, 'GoodId');
$.ajax({
url: "/Goods/DetailInfo",
type: "GET",
data: { id: celValue }
})
.done(function (partialViewResult) {
$("#goodDetInfo").html(partialViewResult);
});
},
//to change good's full view after row deleting
loadComplete: function(data){
var myGrid = $('#GridTable'),
selRowId = myGrid.jqGrid('getGridParam', 'selrow'),
celValue = myGrid.jqGrid('getCell', selRowId, 'GoodId');
$.ajax({
url: "/Goods/DetailInfo",
type: "GET",
data: { id: celValue }
})
.done(function (partialViewResult) {
$("#goodDetInfo").html(partialViewResult);
});
},
autowidth: true,
multiselect: false
}).navGrid('#pager', { edit: false, add: true, del: true, search: false, refresh: true },
{
// edit options
zIndex: 100,
url: '/Goods/Edit',
closeOnEscape: true,
closeAfterEdit: true,
recreateForm: true,
afterComplete: function (response) {
if (response.responseText) {
alert(response.responseText);
}
var myGrid = $('#GridTable'),
selRowId = myGrid.jqGrid('getGridParam', 'selrow'),
celValue = myGrid.jqGrid('getCell', selRowId, 'GoodId');
$.ajax({
url: "/Goods/DetailInfo",
type: "GET",
data: { id: celValue }
})
.done(function (partialViewResult) {
$("#goodDetInfo").html(partialViewResult);
});
}
},
{
// add options
zIndex: 100,
url: "/Goods/Create",
closeOnEscape: true,
closeAfterAdd: true,
afterComplete: function (response) {
if (response.responseText) {
alert(response.responseText);
}
}
},
{
// delete options
zIndex: 100,
url: "/Goods/Delete",
closeOnEscape: true,
closeAfterDelete: true,
recreateForm: true,
msg: "Are you sure you want to delete this task?",
afterComplete: function (response) {
if (response.responseText) {
alert(response.responseText);
}
}
});
$('#GridTable').inlineNav('#pager', {
edit: true,
add: false,
del: false,
cancel: true,
editParams: {
keys: true,
afterSubmit: function (response) {
if (response.responseText) {
alert(response.responseText);
}
var myGrid = $('#GridTable'),
selRowId = myGrid.jqGrid('getGridParam', 'selrow'),
celValue = myGrid.jqGrid('getCell', selRowId, 'GoodId');
$.ajax({
url: "/Goods/DetailInfo",
type: "GET",
data: { id: celValue }
})
.done(function (partialViewResult) {
$("#goodDetInfo").html(partialViewResult);
});
}
},
});
});
The properties and callback function of editParams parameter of inlineNav can be found here. What you need is probably aftersavefunc or successfunc instead of afterSubmit, which exist only in form editing method (see here). The parameters of aftersavefunc or successfunc callbacks are described here (as parameters of saveRow), but the parameters depend on the version of jqGrid, which you use and from the fork of jqGrid (free jqGrid, commercial Guriddo jqGrid JS or an old jqGrid in version <=4.7). I develop free jqGrid fork and I would recommend you to use the current (4.13.3) version of free jqGrid.