calculated columns after filtering (may be using fnFooterCallback with columnFilter)
calculated columns after filtering (may be using fnFooterCallback with columnFilter)
Hi Everybody,
I want to calculate columns after filtering. I use columnFilter for special parts. Also I want to calculate the other columns. How can I do this?
I explain my problem with IMG : http://postimg.org/image/3vpekzvg1/full/
[code]
$(document).ready(function () {
$.datepicker.regional[""].dateFormat = 'dd.mm.yy';
$.datepicker.setDefaults($.datepicker.regional['']);
// Deneme kodu
// deneme kodu bitiş
oTable = $('#example').dataTable(
{
"bJQueryUI": true,
"sPaginationType": "full_numbers"
});
$('#example').dataTable().columnFilter({ /*sPlaceHolder: "head:after",*/ aoColumns: [
{ type: "null" }, { type: "date-range" }],
});
} );
$(document).ready(function() {
$('#example').dataTable( {
} );
Diesel Statistics
Tarih
Toplam Km
Yapılan Km
Litre
Yüzde
Operation
@{
var aratoplam = 0.0;
}
@foreach (var item in trkList)
{
var date = Convert.ToDateTime(@item.Date);
string startdate = date.ToString("dd.MM.yyyy");
aratoplam = aratoplam + @item.TruckKm;
var TruckKmYuzde = new double();
TruckKmYuzde = Math.Ceiling(@item.Litre/((@item.TruckKm)/100));
@startdate
@aratoplam
@item.TruckKm
@item.Litre
% @TruckKmYuzde
@Html.ActionLink("Edit", "DieselEdit", new { id=item.TruckDieselStatisticId } ) | @Html.ActionLink("Delete", "DieselDelete", new { id=item.TruckDieselStatisticId } )
}
Total
Tarih
Total Km
Operation
@Html.ActionLink("Back to List", "Index")
[/code]
Thanks
I want to calculate columns after filtering. I use columnFilter for special parts. Also I want to calculate the other columns. How can I do this?
I explain my problem with IMG : http://postimg.org/image/3vpekzvg1/full/
[code]
$(document).ready(function () {
$.datepicker.regional[""].dateFormat = 'dd.mm.yy';
$.datepicker.setDefaults($.datepicker.regional['']);
// Deneme kodu
// deneme kodu bitiş
oTable = $('#example').dataTable(
{
"bJQueryUI": true,
"sPaginationType": "full_numbers"
});
$('#example').dataTable().columnFilter({ /*sPlaceHolder: "head:after",*/ aoColumns: [
{ type: "null" }, { type: "date-range" }],
});
} );
$(document).ready(function() {
$('#example').dataTable( {
} );
Diesel Statistics
Tarih
Toplam Km
Yapılan Km
Litre
Yüzde
Operation
@{
var aratoplam = 0.0;
}
@foreach (var item in trkList)
{
var date = Convert.ToDateTime(@item.Date);
string startdate = date.ToString("dd.MM.yyyy");
aratoplam = aratoplam + @item.TruckKm;
var TruckKmYuzde = new double();
TruckKmYuzde = Math.Ceiling(@item.Litre/((@item.TruckKm)/100));
@startdate
@aratoplam
@item.TruckKm
@item.Litre
% @TruckKmYuzde
@Html.ActionLink("Edit", "DieselEdit", new { id=item.TruckDieselStatisticId } ) | @Html.ActionLink("Delete", "DieselDelete", new { id=item.TruckDieselStatisticId } )
}
Total
Tarih
Total Km
Operation
@Html.ActionLink("Back to List", "Index")
[/code]
Thanks
This discussion has been closed.