zeitlin / jquery-datatables-row-grouping

Automatically exported from code.google.com/p/jquery-datatables-row-grouping
0 stars 0 forks source link

Undefined variable 'an' #8

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When I trying to use this plugin I got an error.

Error: an is undefined
Source: http://localhost/components/com_cross/assets/js_libs/dataTables.js
Line: 5381

On this line(_fnProcessingDisplay function)
for ( var i=0, iLen=an.length ; i<iLen ; i++ )

If I remove the plugin all works as expected. Maybe my code is very on steroids?

$.fn.dataTableExt.oApi.fnReloadAjax = function(oSettings, sNewSource, 
fnCallback, bStandingRedraw){
    if (typeof sNewSource != 'undefined' && sNewSource != null) {
        oSettings.sAjaxSource = sNewSource;
    }
    this.oApi._fnProcessingDisplay(oSettings, true);
    var that = this;
    var iStart = oSettings._iDisplayStart;

    oSettings.fnServerData(oSettings.sAjaxSource, [], function(json){
        that.oApi._fnClearTable(oSettings);

        for (var i=0 ; i<json.aaData.length ; i++) {
            that.oApi._fnAddData(oSettings, json.aaData[i]);
        }

        oSettings.aiDisplay = oSettings.aiDisplayMaster.slice();
        that.fnDraw();

        if (typeof bStandingRedraw != 'undefined' && bStandingRedraw === true) {
            oSettings._iDisplayStart = iStart;
            that.fnDraw(false);
        }

        that.oApi._fnProcessingDisplay(oSettings, false);

        if (typeof fnCallback == 'function' && fnCallback != null) {
            fnCallback(oSettings);
        }
    }, oSettings);
}
oTable = $("#list").dataTable({
    "bJQueryUI": true,
    "bProcessing": true,
    "bServerSide": true,
    "iDisplayLength": 25,
    "oLanguage": { "sUrl": "<?php echo JURI::base(); ?>components/com_cross/assets/js_libs/locale/dataTables-ru.json"},
    "sAjaxSource": "index.php?option=com_cross&controller=frontpage&task=records&format=raw&cid=cid_1&place=1",
    "aoColumns": [
        { "mDataProp": null, "bSortable": false, "sDefaultContent": '<?php if(!$this->user->guest): ?><span class="edit_link" title="<?php echo JText::_('COM_CROSS_EDIT'); ?>">&nbsp;</span><?php endif; ?><span class="history_link" title="<?php echo JText::_('COM_CROSS_EDIT_HISTORY'); ?>">&nbsp;</span>', "sClass": "edit_row", "bSearchable": false },
        { "mDataProp": "cd_id", "bSortable": false, "sClass": "hidden_col" },
        { "mDataProp": "cd_station_adr", "bSortable": false, "asSorting": ["asc"] },
        { "mDataProp": "cd_phone", "bSortable": false },
        { "mDataProp": "cd_port", "bSortable": false },
        { "mDataProp": "cd_line_adr", "bSortable": false },
        { "mDataProp": "cd_username", "bSortable": false, "sClass": "helper" },
        { "mDataProp": "cd_user", "bSortable": false, "sClass": "hidden_col" },
        { "mDataProp": "cd_desc", "bSortable": false },
        { "mDataProp": "cd_psb", "bSortable": false }
    ],
    "aaSorting": [[2, "asc"]],
    "bScrollInfinite": true,
    "bScrollCollapse": true,
    "sScrollY": "400px"
});
oTable.rowGrouping({
    iGroupingColumnIndex: 7
});

PS! Problem not is in bScrollInfinite features.

Original issue reported on code.google.com by goodlady...@gmail.com on 11 Oct 2011 at 10:23

GoogleCodeExporter commented 9 years ago
Hi,

Is there a chance to minimize you datatables setting and isolate the problem. 
It is hard to me to detect the error because it is happens in the data tables 
and I do not have source for this. Also I cannot exactly replicate the problem 
because I do not have exact server side settings as you have.

Jovan

Original comment by joc...@gmail.com on 13 Oct 2011 at 11:51

GoogleCodeExporter commented 9 years ago
As there is no further responses I will close this issue.
If it happens again please send me a link to live example.

Thanks,
Jovan

Original comment by joc...@gmail.com on 11 Feb 2012 at 11:01