Confused about DeferedRender and mRender
Confused about DeferedRender and mRender
derchris
Posts: 1Questions: 0Answers: 0
Hi,
first post - hello everybody :)
Basically this is is my initialisation code:
[code]
oTable = $('#Items').dataTable({
"aaSorting": [[1, "desc"]],
"bSortClasses": false,
"bDeferRender": true,
"bProcessing": true,
"sAjaxSource": 'Overview.aspx?GetItems=1',
"fnServerData" : function ( sSource, aoData, fnCallback, oSettings ) {[shortened] },
"aoColumns": [
{ mData: 'BankbewegungID' },
{
mData: 'Datum'
},
{ mData: 'Kontaktname' },
{ mData: 'Verwendungszweck' },
{ mData: 'Betrag' },
{ mData: 'Art' }
],
"fnCreatedRow": function( nRow, aData, iDataIndex ) {
console.log("created");
},
"aoColumnDefs": [
{
"aTargets": [1],
"mRender": function (data, type, full) {
console.log("rendering");
return moment(data).format('L');
}
},
{
"aTargets": [4],
"mRender": function (data, type, full) {
console.log("mRender");
return formatCurrency(data);
},
sType: "currency"
}
[/quote]
Now the strange thing is that i got the following console messages in Firebug:
mRender [1774 times, I can see it counting up]
mRender
created
mRender
created
mRender
created
mRender
created
mRender
created
mRender
created
mRender
created
mRender
created
mRender
created
mRender
created
mRender [1773 times, I can see it counting up]
so I got 1773 items in total, so where this number comes from is clear to me. But: Using DeferendRender, why is mRender called so many times? I would have expected (having 10 items per page) that I initially will see a console log of 10 times mRender, Created
first post - hello everybody :)
Basically this is is my initialisation code:
[code]
oTable = $('#Items').dataTable({
"aaSorting": [[1, "desc"]],
"bSortClasses": false,
"bDeferRender": true,
"bProcessing": true,
"sAjaxSource": 'Overview.aspx?GetItems=1',
"fnServerData" : function ( sSource, aoData, fnCallback, oSettings ) {[shortened] },
"aoColumns": [
{ mData: 'BankbewegungID' },
{
mData: 'Datum'
},
{ mData: 'Kontaktname' },
{ mData: 'Verwendungszweck' },
{ mData: 'Betrag' },
{ mData: 'Art' }
],
"fnCreatedRow": function( nRow, aData, iDataIndex ) {
console.log("created");
},
"aoColumnDefs": [
{
"aTargets": [1],
"mRender": function (data, type, full) {
console.log("rendering");
return moment(data).format('L');
}
},
{
"aTargets": [4],
"mRender": function (data, type, full) {
console.log("mRender");
return formatCurrency(data);
},
sType: "currency"
}
[/quote]
Now the strange thing is that i got the following console messages in Firebug:
mRender [1774 times, I can see it counting up]
mRender
created
mRender
created
mRender
created
mRender
created
mRender
created
mRender
created
mRender
created
mRender
created
mRender
created
mRender
created
mRender [1773 times, I can see it counting up]
so I got 1773 items in total, so where this number comes from is clear to me. But: Using DeferendRender, why is mRender called so many times? I would have expected (having 10 items per page) that I initially will see a console log of 10 times mRender, Created
This discussion has been closed.
Replies
Allan