Home News Contact Us Forum About Us Demos Products F.A.Q.
Shopping Cart
You currently have 0 items in your cart.


Recent Events
  • 23/11/2024 Black Friday 2024

    BIG SALE, 30% discount for all our extensions. Use BF24 coupon code. Hurry up the discount is valid till 3 December.

  • 31/12/2023 New Year SALE

    We are glad to announce New Year SALE. 25% discount for all our extensions. Use NY24 coupon code. Hurry up the discount is valid till 7 January.


2Checkout.com, Inc. is an authorized retailer of goods and services provided by ARI Soft. 2CheckOut




Follow us on twitter



Welcome, Guest
Please Login or Register.    Lost Password?

Auto change table row color for dynamic data
(1 viewing) (1) Guest
Go to bottomPage: 12
TOPIC: Auto change table row color for dynamic data
#38014
Re:Auto change table row color for dynamic data 11 Years, 8 Months ago Karma: 0
We getting an error like this when loading page: Datatables warning(table id = 'at_104'): cannot reinitialise data table. To retrieve the DataTables object for this table, pass no arguments or see the docs for bRetrieve and bDestroy.

I was trying to test the fnRowCallback and added to $dtCode

Code:


$(document).ready(function() {
    $("#%1$s").dataTable( {
        "fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull){
            if(aData[0]=="KC978"){
                $(nRow).addClass("delay");
            }return nRow;
        }
    } 
);
});



full $dtCode is
Code:

$dtCode = sprintf('if (typeof(AriDataTables) != "undefined") AriDataTables.hideLoadingPane("#%1$s_wrapper");var options = %2$s;options["fnDrawCallback"] = function(oSettings) { adt_DataTable_DrawCallback(oSettings) };$("#%1$s").addClass("display dataTable").dataTable(options); $(document).ready(function() {$("#%1$s").dataTable( {"fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull){if(aData[0]=="KC978"){$(nRow).addClass("delay");}return nRow;}} );});',
$id,
!empty($jsOptions) ? AriJSONHelper::encode($jsOptions) : ''
//!empty($jsOptions['bJQueryUI']) ? sprintf('/*$("#%1$s_wrapper").find(".dataTables_wrapper").addClass("ui-widget-content")*/', $id) : ''
);



What we have done wrong?
The administrator has disabled public write access.
 
#38030
Re:Auto change table row color for dynamic data 11 Years, 8 Months ago Karma: 760
Hello,

Where we can see the problem?

Regards,
ARI Soft
The administrator has disabled public write access.
 
#38042
Re:Auto change table row color for dynamic data 11 Years, 8 Months ago Karma: 0
The administrator has disabled public write access.
 
#38050
Re:Auto change table row color for dynamic data 11 Years, 8 Months ago Karma: 760
You modified the extension incorrectly and called code which initialized the table twice.

Regards,
ARI Soft
The administrator has disabled public write access.
 
#38064
Re:Auto change table row color for dynamic data 11 Years, 8 Months ago Karma: 0
Thank you!
it's working
the dtCode should be like this
$dtCode = sprintf('if (typeof(AriDataTables) != "undefined") AriDataTables.hideLoadingPane("#%1$s_wrapper");var options = %2$s;options["fnDrawCallback"] = function(oSettings) { adt_DataTable_DrawCallback(oSettings) }; options["fnRowCallback"] = function( nRow, aData, iDisplayIndex, iDisplayIndexFull){if(aData[3].length > 10){$(nRow).addClass("delay");}return nRow; }; $("#%1$s").addClass("display dataTable").dataTable(options); ',
The administrator has disabled public write access.
 
Go to topPage: 12