what is the corresponding of .fnGetPosition in Datatable ?
what is the corresponding of .fnGetPosition in Datatable ?
mlotfi
Posts: 60Questions: 5Answers: 0
Hi,
what is the corresponding of .fnGetPosition in Datatable ?
I am using Datatable with capital T :
$(document).ready(function() {
// $(".button").button();
var oTable = $('#metadataListTable').DataTable({
........
var target_row = $(this).closest("tr").get(0);
var aPos = oTable.fnGetPosition(target_row); <--------- undefined
oTable.fnUpdate('T',aPos,9);
Thanks.
This discussion has been closed.
Replies
row().index()
,column().index()
andcell().index()
.Ther eis a conversion guide available here.
Allan
Thanks allan,
I got confused , I don't know how to do the conversion :
You may want to call
draw()
as well.Allan
Thank you allan, it works now
I have a problem reading row data :
Hi allan,
I found the solution :
when you put this order :
data will be undefined
but when you swap the above lines :
data is defined.
this is very strange.
There is a problem when trying to update two cells in the same event (for example click), the first cell data got updated but the second one throw an error :
Uncaught TypeError: Cannot read property 'row' of undefined
here is my code :
Are you using server-side processing (without a link to a test case, as required in the forum rules, it is hard to know the full picture). If so, then you don't want to call
draw()
as that would refresh the page.Beyond that, I think we probably would need a link to the page to understand what is going wrong.
Allan
I created a jsfiddle, the update of the two cells data works fine, but locally in my machine it does not, here is the fiddle :
http://jsfiddle.net/mlotfi/1z3bnwwp/
in my local code when I switch the above two lines to :
I tried this test :
Always the the first cell get updated but not the second one, it looks like the row got lost, anything to handle this problem will be appreciated.
I would need a test case that shows the problem I'm afraid. As you noted, the test case you've provided doesn't appear to show a problem, so I can't fix it as there is nothing to fix! :-)
Allan