Update datatables after insert in db. Maybe hash?
Update datatables after insert in db. Maybe hash?

Hello,
My datatables works very well. For Update I used ajax reload and works.
The problem is first time because I can't to get ID from webmethod.
This is my code
` /RELACIJE/
$('#Relacije').DataTable({
serverSide: false,
ajax: {
url: 'webservice/sluzbenapotovanja.asmx/PripeteRelacije',
type: 'GET',
data: { username: $.cookie("user"), password: $.cookie("pass"), IdPodjetja: localStorage.getItem("IdPodjetja"), IdNaloga: getHashValue('IdNaloga') },
dataType: "json",
},
"columns": [
{ "data": "ID", "visible": false },
{ "data": "Relacija" },
{ "data": "Kilometrov" },
{ "data": "KilometrinaTujina", "visible": false },
{ "data": "OpisNamena", "visible": false },
{ "data": "DatumRelacije", "visible": false },
]
});
`
Like this I retrieved data. It's ok.
Now I used hash solution but not works. If hash ID has been changed, then displays previous data. if reload page then again works.
If used this code in my ajax success works, but after that I got error reiniatilize not possible...
The answer is how can I used hash url for retrieve data after change without reloading?
Answers
If I understand the problem correctly you want the
ajax.data
to be dynamic. If thats correct then you will want to useajax.data
as a function. The docs have examples of this.Kevin