I have the following code in one file:
function refreshGridSuccess(responseText, entity) {
oTable = $('#dataTable').dataTable({
"sScrollX": "100%",
In another file I have:
$('#detailData')
.on('click', '.sort-up', function (event) {
event.preventDefault();
var column = $(this).closest('th'),
columnIndex = column.parent().children().index(column.get(0));
oTable.fnSort([[columnIndex, 'asc']]);
return false;
})
I have no definition for oTable
except here. The scripts seem to work so does that mean that oTable
was somehow made into a global variable?
Now I am trying to start using Typescript and it will not accept Otable
without it being declared. Is there a way I can declare oTable
as an object or do I have to declare it as an object to be the same type as is returned by $('#dataTable').dataTable({})
?