How to reload an ajax link in an editor?
How to reload an ajax link in an editor?
eventime
Posts: 3Questions: 2Answers: 0
editor = new $.fn.dataTable.Editor({
ajax: {
url: someurl,
data: somedata
table: '#table',
idSrc: "id",
fields: [
{
label: somelable,
name: somename,
type: 'datatable',
editor: stuff_editor,
optionsPair: {
value: 'id',
},
config: {
ajax: someurl',
columns: [
{
title: title1,
data: data1
},
{
title: title2,
data: data2
},
],
}
I want to reload 'somelable' s ajax after 'stuff_editor' s submission, how can I write the code?
Answers
You could use the
submitComplete
event:That shouldn't be needed though. The response from
someurl
should contain the data that is needed to update the table after the edit. That is what happens in the examples.Allan
Thank you for the answer. I need to elaborate on my case. The ajax I want to reload is
editor.fields[0].config.ajax
, trigger bystuff_editor
. This is a table ineditor
, I can't find how to call it. The method you provide seems not work.Oh I see - sorry. You can use the
dt()
method of thedatatable
field type to get the DataTable instance.i.e. do this:
Allan