Using iDeferCount does not defer initial load

Using iDeferCount does not defer initial load

dmccleandmcclean Posts: 13Questions: 2Answers: 0
edited October 2013 in General
I am trying to use the iDeferCount with DataTables, but the call to initialize the datatable
is causing an ajax load. I have bServerSide set to false, perhaps that is the issue, but
I am not sure why. My init code is: (coffeescript)

[code]

@init_layer_datatable: (tableId,ajax_src,customSettings) ->
defaultSettings =
iDeferLoading: 50
aoColumns: [null,null,null,null,null,null,null,null]
bSort: false
bPaginate: false
bFilter: false
bAutoWidth: false

bProcessing : true
bServerSide : false
sAjaxSource : ajax_src
oLanguage : {
sZeroRecords : 'No entries exist'
sEmptyTables : 'No entries exist'
}
sDom: "<'row'<'span6'l><'span6'f>r>t<'row'<'span6'i><'span6'p>>"

fnServerData: (sSource, aoData, fnCallback) ->
#All search fields will have a class of search field
if not aoData?
aoData = []

$.ajax(
dataType: 'json'
type: 'GET'
url: sSource
data: aoData
success: (json,status) ->
fnCallback(json)
)
finalSettings = Fei.merge(defaultSettings,customSettings)
$('#' + tableId).dataTable(finalSettings)
[/code]

Any help would be appreciated.

Thanks,
Don Mc

Replies

  • dmccleandmcclean Posts: 13Questions: 2Answers: 0
    Sorry, the title of the discussion is incorrect, the parameter should be iDeferLoading, not iDeferCount.
    That is what I am using i

    Don
  • dmccleandmcclean Posts: 13Questions: 2Answers: 0
    Never mind, I confirmed by reading other posts that serverSide must be set to true.

    Don
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    This is correct - currently iDeferLoading doesn't work with just Ajax loaded data. I have looked into adding it for 1.10, but it would be a surprisingly large amount of work due to the flow of the code, so it likely won't make it in. It is on the cards for a future release though.

    Allan
This discussion has been closed.