How to expand/ Open the drilldown options when opening the website

How to expand/ Open the drilldown options when opening the website

mmcwmmcw Posts: 23Questions: 0Answers: 0
edited October 2012 in General
Hello,

Could zomeone help me?

I would like to use the drilldown option like shown on: http://datatables.net/blog/Drill-down_rows
On the page: http://www.datatables.net/ref#mRender you see that the hidden parts are expanded by default.

How to change my code that the drilldowns are opened when the page is loaded?


[code]






 
Product
Naam
Score
Datum toegevoegd
Beoordeling
Bewerk




Loading data from server




 
Product
Naam
Score
Datum toegevoegd
Beoordeling
Bewerk




$(document).ready(function() {
var anOpen = [];
var sImageUrl = "/admin_new/images/";

var oTable = $('#dt_gateway_log').dataTable( {
"bProcessing": true,
"bServerSide": true,
"bStateSave": true,
"fnStateSave": function (oSettings, oData) {
localStorage.setItem( 'DataTables_'+window.location.pathname, JSON.stringify(oData) );
},
"fnStateLoad": function (oSettings) {
var data = localStorage.getItem('DataTables_'+window.location.pathname);
return JSON.parse(data);
},
"sPaginationType": "full_numbers",
"sResetImage": "/admin_new/images/reset.png",
"oLanguage": {
"sUrl": "/admin_new/js/libraries/i18n/jquery.dataTables.nl.js"
},
"aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, "Alles"]],
"aaSorting": [
[ 2, "desc" ]
],
"aoColumns": [
{
"mDataProp": null,
"sClass": "control center",
"sWidth": "20px",
"bSortable": false,
"sDefaultContent": ''
},
{
"mDataProp": null,
"fnRender": function ( o, val ) {
return o.aData[1];
},
},
{
"mDataProp": null,
"fnRender": function ( o, val ) {
return o.aData[2];
}
},
{
"mDataProp": null,
"fnRender": function ( o, val ) {
return '';
},
"sClass": "align-top",
"sWidth": "100px"
},
{
"mDataProp": null,
"fnRender": function ( o, val ) {
return o.aData[4];
},
"sClass": "align-top",
"sWidth": "140px"
},
{
"mDataProp": null,
"fnRender": function ( o, val ) {
return nl2br(o.aData[8]);
},
"bSortable": false,
"sClass": "align-top"
},
{
"mDataProp": null,
"fnRender": function ( o, val ) {
var dt_edit = '';
dt_edit = 'Bewerken';
var dt_remove = '';
dt_remove = 'Verwijderen';
return dt_edit+dt_remove;
},
"sClass": "align-center align-top",
"sWidth": "70px",
"bSortable": false
}
],
"fnRowCallback": function( nRow, aData, iDisplayIndex ) {
$(nRow).addClass('gradeA');
return nRow;
},
"sAjaxSource": "/admin_new/connectors/php/server_processing.php?process=reviews&status=0&sMultiWords=1",
"fnDrawCallback": function(oSettings, json) {
$(".tip-table").tipTip({
edgeOffset: 1
});
$('.rateit').rateit();
}
});

$('#dt_gateway_log td.control').live( 'click', function () {
var nTr = this.parentNode;
var i = $.inArray( nTr, anOpen );

$(anOpen).each( function () {
if ( this !== nTr ) {
$('td.control', this).click();
}
});

if ( i === -1 ) {
$('img', this).attr( 'src', sImageUrl+"details_close.png" );
$('img', this).attr( 'id', "close" );
var nDetailsRow = oTable.fnOpen( nTr, fnFormatDetails(oTable, nTr), 'details' );
$('div.innerDetails', nDetailsRow).slideDown();
anOpen.push( nTr );
}
else {
$('img', this).attr( 'src', sImageUrl+"details_open.png" );
$('img', this).attr( 'id', "open" );
$('div.innerDetails', $(nTr).next()[0]).slideUp( function () {
oTable.fnClose( nTr );
anOpen.splice( i, 1 );
});
}
});
});

function fnFormatDetails( oTable, nTr ) {
var oData = oTable.fnGetData( nTr );
var sOut =
''+
''+
'Product:'+oData[1]+''+
'Naam:'+oData[2]+''+
'Score:'+
'Datum toegevoegd:'+oData[4]+''+
'IP adres:'+oData[5]+''+
'Beoordeling:'+oData[8]+''+
''+
''+
'$(\'.rateit_more\').rateit();<\/script>';
return sOut;
}

[/code]

greetings Michel
This discussion has been closed.