Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all 79619 articles
Browse latest View live

Fixed header Alignment issue.

$
0
0

Like many others I have an issue with the fixed header not aligning properly as I start to scroll.

The code pen I have created doesn't have the problem. see here

However, my development site which uses the same code does. see here

I have tried using a small data set as well on the dev site but the results are the same.

I have seen the columns.adjust().draw() but am not 100% sure where to place this.


Drag value and copy over to other rows - Like excel

$
0
0

Hi,

I have got a feature request - not sure if some has implemented something similar. If so, then please share a reference.

Request - Our users want to copy over comments entered in row 1 to other rows say until row 10... like we do in excel

thanks
S

wholesale Minky Heart Embossed Blanket

$
0
0

About Us
ABC Industrial Ltd was established in 2010. And it's located in Jiaxing city, Zhejiang province, China. We have employed the most creative and baby knowledgeable people in the city.
All of the employees here at ABC-TEX are avid crafters, quilters, sewer, knitters and true artists.
Our Product
We are specialized in designing, developing and exporting baby textile items. Our main products include weighted blanket, baby minky blankets, baby car seat canopy, baby mermaid blanket, bibs, swaddle, pillowcase, tag blankets and other baby textile items. We focus on producing well quality, competitive prices, safe package, and short delivery time. Therefore, we always satisfy your demands and have lots of customer base.
Production Equipment
We have a dozen of the most advanced cutting beds, sewing machines and skilled operators, which ensure superior and steady quality.
Our Service
An energetic and professional sales term provides 24 hours online service. You can get one-year quality warranty after receiving the order from us. We have the best textile quality in China and we trust our products will satisfy you.wholesale Minky Heart Embossed Blanket
website:http://www.babyminkyblanket.com/

China Kids Ski Goggles manufacturers

$
0
0

Features a small youth frame. This goggle fits youth from ages 6-14 years old.
Double-layer face foam with micro fleece facing
Anti-fog coating to keep your little one's vision crisp and clear in all conditions
Seamless compatibility with Giro youth helmet.
Product NameKid Snow goggles,ski goggles, snow boarding goggles
HS Code9003110000
SizeKids, children,unisex
Model No.P304
UsageSkiing, snow Sports, skating, outdoor used
Main featuresFlexible frame conforms to any face for a comfortable fit
TPU flexible frame, custom paint
Dual lens with anti-fog and anti-scratch protection
Lens &strap removable
100 per cent UV protection
Triple-layer face foam featuring moisture-wicking Dri-Force fleece
Dual-adjustment, silicone-ribbed strap
Easy fit strap adjustment system
Helmet compatible
Available flight strap
Product DescriptionLarge size fashionable snow goggles. Big and wide lens, hydro-film frame, colorized electroplating lens,UV400
Competitive Advantage(1)CE certificate for Europe market.
(2)FDA certificate for America market.
(3)Quality management of system certificate of approval: ISO9001:2008.
(4)Have more than 7 years of exporting experience to Europe and America.
(5)High quality and very competitive price.
FrameMaterial: TPU
Color: Any color is OK
Water transfer printing is available
LensMaterial: PC
Double lens
Flat or Spherical: Cylindrical
Color: Any color
Vents: yes
Anti-UV: 100 per cent
Anti-Scratch: yes
Anti-Fog: yes
Strap:Material: Nylon
Adjustable: yes
Width & thickness: 40x 2 mm,
Max Length: 70cm
LOGO: custom LOGO is OK but the MOQ is 500 pieces per model
FoamMaterial: polyethylene
Thickness:15mm
ServiceOEM, Design, buyer logo service offered
PaymentT/T, L/C,PayPal, Western Union
Leading time25-35 days
Package(1) Transparent PE Pouch.
(2) Transparent PET Folding Box.
(3) Color Carton with Window.
(4) Micro-fiber Bag.
(5) EVA Case
(6)custom design is OK but the minimum order is 500 pieces.
Quantity in each carton:Quantity in each carton: 100 pcs
Carton dimension: 47.246109cm
Inside box dimension: 462221cm
Compatible with Kids Less than about 12 Years Old. TPU Frame + Revo Mirror Lens, Protect your eyes and faces when skiing, snowboarding, snowmobiling and other snow sports. Spherical shape, keep off wind, keeping your eyes and faces warm, protecting your eyes and faces from hurt. Enough inner space for myopia glasses. FDA Drop Ball Test Certification.
High quality lens and frame. Italian-made lens, wide view, UV protection, dual-layer PC materials, solid and flexible. Spherical wide vision design, provides more than 180 degree view. 100% ultraviolet rays protection and adjust the brightness to comfortable level. Double layers poly carbonate (PC) materials, solid and flexible, can bear strong strike, protecting you from hurt.
Detachable/replaceable architecture. Detachable/replaceable strap allows for easy premium-strap upgrades. Highly elastic strap with easy-slide adjusters provides comfortable secure fit over helmets or hats.
Ultra-soft, triple-layer (2-foam, 1 soft fleece), absorbent and breathable memory foam gives optimal face contact for the most comfortable fit. Active venting system prevents condensation and fogging.China Kids Ski Goggles manufacturers
website:http://www.bestsportgoggles.com/ski-goggles/kids-ski-goggles/

China Gearboxes For Internal Mixers

$
0
0

Our History
JIANGYIN DELING GEARBOX CO.,LTD, a professional designer and producer of hard tooth surface gearboxes, from its very first day of operation to now, it has been concentrating in developing and manufacturing the gearboxes especially for rubber and plastic machinery for over 20 years in China.
Our Factory
JIANGYIN DELING GEARBOX CO.,LTD is located in Qiaoqi Industrial Park of Jiangyin city, Jiangsu province, which is 1.5 hours away from Shanghai.
Our Product
Our main products are: ZLYJ series single screw extruder gearbox; SZ, SZ-L, SZL, SJZ, SZW series conical twin-screw gearbox; YPS series counter-rotating parallel twin screw gearbox; TPS series co-rotating parallel twin screw gearbox; MBY,ZDY,ZLY,ZSY series cylindrical gearbox; DLHZ port dedicated rotary series; DLW,DLS planetary winch series; DP series planetary reducer series; DPM twin shaft concrete mixer series; XK rubber mill series; ZSYF calender series; NL refining machine; XM mixer series, and according to user requirements and design and manufacture of various hardened gear boxes.
Product Application
Deling gearbox are widely used in the following industry:
---plastic pipe/profile/board/foam board/sheet extruder line
---plastic firm blowing extruder line
---plastic recycling & pelletizing production line
---rubber industry
---ports field
---metallurgy field
---mining field
---building materials field
---petrochemical field
Our Certificate
We always feel that all success of our company is directly related to the quality of the products we offer. They meet the highest quality requirements as stipulated in ISO9001:2008, GB/T19001-2008,CE Certification and New Hi-tech Enterprises Certification and our stringent quality control system.
Production Equipment
Our group constantly introduce domestic and foreign advanced production equipment and processing technology, with all types of large and medium-size CNC hobbing machine, CNC profile grinding machine, CNC machining center, CNC boring mill, CNC gear shaper, heat treatment furnace, gear testing center and other advanced processing and testing equipment.
Production Market
Deling will take the advantage of the experience accumulated from twenty years and hundreds of thousands of gearboxes being made and to be always look at the demands of the customers to create the most innovative models. Our continuous research and development is for supplying excellent first-class gear transmission equipment for our customer; Country-wide marketing and service network is for marking perfect after-sales service.
Our service
Besides our existing products, we also can customize products according to the drawings or samples from our customers. We control the product quality critically for every step during the manufacturing from lathe process to gear hobbing machine. We offer technical support that is second to none. We have a professional after-sales service team, including professional engineering technicians and extensive after-sales service network. We will do everything we can to help you solve all problems.China Gearboxes For Internal Mixers
website:http://www.delinggearbox.com/
website2:http://www.dl-gearbox.com/

Sorting value is come from joined table, not working editor drag and drop sorting.

$
0
0

My client side defined like this. I am using Laravel in server side. I am new to Datatable, I really don't idea what is the problem.

editor = new $.fn.dataTable.Editor( {
ajax: {{ route('words.dt', $baseklass->id) }},
table: '#m_table_1',
fields: [ {
label: 'Order:',
name: 'sort.sort',
fieldInfo: 'This field can only be edited via click and drag row reordering.'
}, {
label: 'Word:',
name: 'word.word'
}, {
label: 'Key word:',
name: 'keyword.0.key_word'
}, {
label: 'Translation',
name: 'word_translation.0.translation'
},{
label: "Image:",
name: 'image[].id',
type: "upload",
dragDrop: false,
display: function ( image ) { return image.length},
clearText: "Clear",
noImageText: 'No image '
}

        ]
    } );

~~~~

var table = $('#m_table_1').DataTable( {
dom: 'Bfrtip',
"pageLength": 100,
ajax: '{{ route('words.dt', $baseklass->id) }}',
columns: [
{ data: 'sort.sort', className: 'reorder' },
{
data: null,
defaultContent: '',
className: 'select-checkbox',
orderable: false
},
{ data: 'word.word' },
{ data: "keyword.0.key_word",
editField: "keyword.0.key_word",
render: function(data){
return data? data:'No keyword'
}
},
{ data: 'word_translation.0.translation',
editField: "word_translation.0.translation",
render: function(data){
return data? data:'No translation'
}
},
{
data: "image[].image",
editField: false,
render: function ( data ) {
return data? '<img class="img" src="/storage/'+data[0]+'"/>':'No image!';
},

            },
        ],
        columnDefs: [
            { orderable: false, targets: [ 1,2,3 ] }
        ],
        rowReorder: {
            dataSrc: 'sort.sort',
            editor:  editor
        },
        responsive: {   
            details: {
                type: 'column',
                target: 1
            }
        },
        select: true,
        buttons: [
            { extend: 'create', editor: editor },
            { extend: 'edit',   editor: editor },
            { extend: 'remove', editor: editor }
        ],
    } );

Issue is drag drop working but not request sending to server side and data swapping but value is not changing(after new refresh it comes old again).
In addition Sort is comes from joined table not actually main table.

\DataTables\Editor::inst( $db, 'word')
->fields(
Field::inst( 'word.word' ),
Field::inst( 'sort.sort' )
->validator( 'Validate::numeric' ),
Field::inst( 'word_category.baseklass_id' )
)
->leftJoin('sort', 'sort.word_id', '=', 'word.id')

Value from joined table, can be sort by drag drop editor?

$
0
0
**   Server section **
    \DataTables\Editor::inst( $db, 'word')
        ->fields(
            Field::inst( 'word.word' ),
            Field::inst( 'sort.sort' )
                ->validator( 'Validate::numeric' ),
            Field::inst( 'word_category.baseklass_id' )
        )
        ->leftJoin('sort', 'sort.word_id', '=', 'word.id')

** Defined in Editor**
{
label: 'Order:',
name: 'sort.sort',
fieldInfo: 'This field can only be edited via click and drag row reordering.'
},
** Defined in Datatable**
{ data: 'sort.sort', className: 'reorder' },
** Config**
rowReorder: {
dataSrc: 'sort.sort',
editor: editor
},

AutoFill Cells column name

$
0
0

Hi,

I have recently implemented autofill functionality which works fine but I need to know the cells column name? How can I get column name?

$("#tableDT").on("click", "td", function () {
var th = $('#tableDT th').eq($(this).index());
selectedtable = 'detail';
selectedcolumn = th.text(); // this does't work because for Autofill we don't click on cell instead we click on corner square
});

Implementation: since the column where in I have implemented autofill generates score so after as soon as autofill is completed I want to know the column name so that I can fire my generate score function.


SyntaxError: unexpected token: '{' in datatables.css:16:16

$
0
0

Hi,
I am getting the error msg as indicated by the title of this Question. My html file is as follows. My table '#word_freq_table' is defined in one of my js files.
Could anybody help please? Thank you in advance.
best regards
Jim

Here is my html file:

<!doctype html>
<html lang="en">
  <head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

<script type="text/javascript" src="js/jquery-3.3.1.js"></script>
<script type="text/javascript" src="js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="js/datatables.js"></script>
<script type="text/javascript" src="js/datatables.css"></script>

<script src="js/hilitor.js"></script>
<script src="js/sorttable.js"></script>

<script src="js/word_freq.js"></script>
<script src="js/json_to_table.js"></script>

<script src="bower_components/underscore/underscore.js"></script>
<script src="js/lemmatizer.js"></script>
<link rel="stylesheet" type="text/css" href="js/styles.css">

<script type="text/javascript">

    $(document).ready(function() {
        $('#word_freq_table').DataTable();
    });

</script>

</head>

<body>

<div  class=col_left>
  <div class=upper_left>
    Paste your passage here:<p>
    <textarea id=input_passage onchange=output_freq(this.value)></textarea>
    <p>
    <button type=submit id=analyse onclick=output_freq(document.getElementById('input_passage').value)> Analyse</button>
    <p>
  </div>
 
  <div id=freq></div>

</div>

<div id=output_passage class=col_center></div>

<div id=right_col class=col_right></div>

<script>

</script>

</body>
</html>

why datatables not working after i move it into different server?

$
0
0

the previous server datatables works just fine but the new server does not. already move the datatables folder but still
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- Meta, title, CSS, favicons, etc. -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

<!-- Bootstrap -->
<link href="../vendors/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- Font Awesome -->
<link href="../vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<!-- NProgress -->
<link href="../vendors/nprogress/nprogress.css" rel="stylesheet">
<!-- iCheck -->
<link href="../vendors/iCheck/skins/flat/green.css" rel="stylesheet">
<!-- Datatables -->
<link href="../vendors/datatables.net-bs/css/dataTables.bootstrap.min.css" rel="stylesheet">
<link href="../vendors/datatables.net-buttons-bs/css/buttons.bootstrap.min.css" rel="stylesheet">
<link href="../vendors/datatables.net-fixedheader-bs/css/fixedHeader.bootstrap.min.css" rel="stylesheet">
<link href="../vendors/datatables.net-responsive-bs/css/responsive.bootstrap.min.css" rel="stylesheet">
<link href="../vendors/datatables.net-scroller-bs/css/scroller.bootstrap.min.css" rel="stylesheet">

<script type="text/javascript">
$(document).ready(function () {
    $('#table_id').dataTable();
});

</script>

// JQuery Reference, If you have added jQuery reference in your master page then ignore,
// else include this too with the below reference


<link rel="stylesheet" href="https://cdn.datatables.net/1.10.4/css/jquery.dataTables.min.css">
<!-- Custom Theme Style -->
<link href="../build/css/custom.min.css" rel="stylesheet">
</head>

Uncaught ReferenceError: define is not defined

$
0
0

Hello,
I am trying to to use the DataTable Editor, the one with the basic initialization. But I have so many errors being reported as shown below. I am using the js libraries and css libraries specified in the examples and they are -

<link rel="stylesheet" href="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css"/>
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.5.4/css/buttons.dataTables.min.css"/>
<link rel="stylesheet" href="https://cdn.datatables.net/select/1.2.7/css/select.dataTables.min.css"/>
<link rel="stylesheet" href="https://editor.datatables.net/extensions/Editor/css/editor.dataTables.min.css"/>

<script src="https://code.jquery.com/jquery-3.3.1.js"></script> 
<script src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script> 
<script src="https://cdn.datatables.net/buttons/1.5.4/js/dataTables.buttons.min.js"></script> 
<script src="https://cdn.datatables.net/select/1.2.7/js/dataTables.select.min.js"></script> 
<script src="https://editor.datatables.net/extensions/Editor/js/dataTables.editor.min.js"></script>  

**Now the errors are - **

dataTables.editor.min.js:1 Uncaught ReferenceError: define is not defined
at dataTables.editor.min.js:1
at dataTables.editor.min.js:1
(anonymous) @ dataTables.editor.min.js:1
(anonymous) @ dataTables.editor.min.js:1

jquery-3.3.1.js:3818 jQuery.Deferred exception: $.fn.dataTable.Editor is not a constructor TypeError: $.fn.dataTable.Editor is not a constructor
at HTMLDocument.<anonymous> (http://127.0.0.1:5500/editDataTable.html:31:15)
at mightThrow (https://code.jquery.com/jquery-3.3.1.js:3534:29)
at process (https://code.jquery.com/jquery-3.3.1.js:3602:12) undefined
jQuery.Deferred.exceptionHook @ jquery-3.3.1.js:3818
process @ jquery-3.3.1.js:3606
setTimeout (async)
(anonymous) @ jquery-3.3.1.js:3640
fire @ jquery-3.3.1.js:3268
fireWith @ jquery-3.3.1.js:3398
fire @ jquery-3.3.1.js:3406
fire @ jquery-3.3.1.js:3268
fireWith @ jquery-3.3.1.js:3398
ready @ jquery-3.3.1.js:3878
completed @ jquery-3.3.1.js:3888

jquery-3.3.1.js:3827 Uncaught TypeError: $.fn.dataTable.Editor is not a constructor
at HTMLDocument.<anonymous> (editDataTable.html:31)
at mightThrow (jquery-3.3.1.js:3534)
at process (jquery-3.3.1.js:3602)

I have not clue what's happening here :( Can anybody help me understand what I could be doing wrong? All the css and js libraries are straight from the example.

I have also attached the source file to show what I am doing.

Any help would be highly appreciated!

Thank you.
TR

Unable to download using html5 bottons

$
0
0

Hi, I am using html5 buttons to download table data. Table contains around 4900 rows. It works for rows until 4670 but if it’s more than that and when I click the button it’s showing loading icon in the button and nothing happened after that. This issue is happening only in chrome browser. Any restriction on the rows in chrome? Thanks for the help.

language is not working

$
0
0

Tried:

            var oTable = $('#table').DataTable( {
                "language": {
                  "url": "http://cdn.datatables.net/plug-ins/a5734b29083/i18n/German.json"
                }
            } );

And:

            var oTable = $('#table').DataTable( {
                "language": {
                  "url": "http://cdn.datatables.net/plug-ins/9dcbecd42ad/i18n/German.json"
                }
            } );

And:

            var oTable = $('#table').DataTable( {
                "language": {
                  "url": "//cdn.datatables.net/plug-ins/9dcbecd42ad/i18n/German.json"
                }
            } );

And:

        var oTable = $('#table').DataTable( {
            "language": {
              "search": "Suchen"
            }
        } );

And:

        var oTable = $('#table').DataTable( {
            "language": {
              "sSearch": "Suchen"
            }
        } );

And:

        var oTable = $('#table').DataTable( {
            "oLanguage": {
              "sSearch": "Suchen"
            }
        } );

And lots of other combinations and none worked. Thanks in advance.

On sorting the rows by columns the function gets overridden with the default function

$
0
0

before sorting
function works fine
after sorting
function gets overrriden
here is my code;

<script type="text/javascript">
$(document).ready(function() {
    $('#tablename').DataTable.ext.pager.numbers_length = 5;// For setting pagination with elipses(...)
    var table= $('#tablename').DataTable( {
     "initComplete": function( settings, json ) {
      updateServiceButtons();
    },
     "lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
     "pagingType": "full_numbers",
     "processing": true,
     "serverSide": true,
     "ajax":"../tablename_ajax_d/serverSide.php",
     "columns": [
                        { "data": "mm_sno" },
                        { "data": "system_name" },
                        { "data": "ip_address" },
                        { "data": "service_name" },
                        { "data": "service_status" },
                        { "data": "date" },
                        { "data": null },
                        { "data": null }
                    ],      
    "columnDefs": [
                    {
                        "targets": -2,
                        "data": null,
                        "defaultContent": `<button id ="restart-service" class="btn btn-success" data-toggle='modal' data-target='#service-start-stop-modal'>Restart</button>`
                        
                      },
                    {
                        "targets": -1,
                        "data": null,
                        "defaultContent": `<button id ="stop-service" class="btn btn-danger" data-toggle='modal' data-target='#service-start-stop-modal'>Stop</button>`
                      }
                ],
    rowCallback: function(row, data, index){
        if(data.service_status=='running'){
        $(row).find('td:eq(2)').css('color', 'GREEN');
        }
        else if(data.service_status== 'failed'){
        $(row).find('td:eq(2)').css('color', 'red');
        }
    }
    } );

$('#tablename tbody').on( 'click', 'button', function () { 
  var data = table.row( $(this).parents('tr') ).data();
  var type = $(this).attr('id').includes('restart') ? 'restart' : 'stop';
  host_url = `url1`
  $.ajax({
    type: "GET",
    url: `url2`,
    success: function(result){
      try{
        var res = $.parseJSON(result);
        if(res){
          $(".modal-body").html(`Service ${data['service_name']} is successfully ${type}ed`);
        }else{
          $(".modal-body").html(`${res}`);
        }
      }
      catch(error){
        $(".modal-body").html("something went wrong");
      }
    }
  });
});
} );
function updateServiceButtons(){
    var rows = $("tbody").find("tr");
    const RUNNING_STATE = 'running';
    for(var i=0; i<rows.length; i++){
      var elem = $($("tbody").find("tr")[i]);
      if(elem.find(".service-status").text() == RUNNING_STATE){
        elem.find("#restart-service").attr("disabled","disabled");
        elem.find("#stop-service").removeAttr("disabled");
      }else{
        elem.find("#stop-service").attr("disabled","disabled");
        elem.find("#restart-service").removeAttr("disabled");
      }
    }
  }
</script>

Thanks
Koka

EDIT:Update code formatting use triple back ticks.

footercallback does not calculates the column value

$
0
0

It works fine on live.datatables but it does not workout in the development environment (too many fields are used), though i used numeral.js script
reference:

here is my code:

       "footerCallback": function ( row, data, start, end, display ) {
            var api = this.api();
 
            // Remove the formatting to get integer data for summation
            var intVal = function ( i ) {
                return typeof i === 'string' ?
                    i.replace(/[\MB,KB,GB,TB,]/g, '')*1 :
                    typeof i === 'number' ?
                    numeral(i).value() : i;
            };
 
            // Total over all pages
            total = api
                .column( 3 )
                .data()
                .reduce( function (a, b) {
                    return intVal(a) + intVal(b);
                }, 0 );
 
            // Total over this page
            pageTotal = api
                .column( 3, { page: 'current'} )
                .data()
                .reduce( function (a, b) {
                    return intVal(a) + intVal(b);
                }, 0 );
 
            total = numeral(total).format('0.0a');
            pageTotal = numeral(pageTotal).format('0.0a');
          $( api.column( 3 ).footer() ).html(
             '--'+pageTotal +' ( --'+ total +' total)'
            );
        }

Please let me know where did i go wrong?

Thanks
Koka


Cannot wrap numeric data value

$
0
0

Hi guys

Hope you can help me. Im using the table responsive. it wraps long variable data value, but for numeric value it doest wrap. Please advise. thanks

Collapse / Expand Click Groups

$
0
0

Hi all together,

https://datatables.net/extensions/rowgroup/examples/initialisation/customRow.html

I like to have a possibility to click on the group name like "Averages for Edinburgh" and the group should expand/collapse. Per default when loading the site, the group should be collapsed.

For doing that, I also found this thread here, where redwall was able to embed such a function for his DataTable:
https://datatables.net/forums/discussion/comment/61474/#Comment_61474

But my Javascript skills are less than available :)

Would someone of you be so kind and help me out here? How can I reach the above described functionality on the basic example of "Custom row rendering / aggregates"?

Thank you for your help!!

How to avoid RangeError maximum call stack size exceeded?

$
0
0

Enclosing certain statements that load or initialize the DataTable. I have for example a setTimeOut that refreshes it every 30 seconds with ajax.reload.

But it is a component that has to launch this error and it would be good to publish how to avoid these errors and get the best performance. Because it uses many resources to achieve desired functionalities

Parsing "\n" new lines in HTML from JSON string.

$
0
0

So, a little background. I have a datatable set up, it's really rough around the edges, just to display a whole bunch of data from a JSON database. This is how I have it set out

$(document).ready(function() {
    $('#data').DataTable( {
        "ajax": {
            "dataType": 'json',
            "url": "domains.json",
            "dataSrc": "cards"
        },
        "order": [ 3, "desc" ],
        "columns": [
            { "data": "name" },
            { "data": "desc"},
            { "data": "shortUrl",
              "render": function(data, type, row, meta)
              {
                if(type === 'display')
                {
                    data = '<a class="trello-link" target="_blank" href="' + data + '">' + data + '</a> \n Open in Incognito';
                }

                return data;}
            },
            {  "data": "dateLastActivity"}
        ]
    } );
} ); 

And this is pulling information from the JSON database source. The data in the second column "desc" is a string that displays as such in the JSON:

"Some information here\nMore information here\nNext information here"

The "\n" when parsed through into the datatable doesn't form a new line, is there any way this can be performed without major changes to the database structure itself?

Kind Regards,
Ben

RowGroup custom rendering and data source change event combined?

$
0
0

Hi all together,

I combined the custom rendering and the Data source change event examples from this page: https://datatables.net/extensions/rowgroup/examples/

Instead of average salary in the custom rendering example, I used the sum() function to have the sum of salary for each city.

I now need to have a sort option which will sort the groups using the summed up value. When I now click on the last column the single elements in each city will be ordered, but I need the whole groups ordered using the summed up values.

So, e.g. London is the city with the highest over all salaries, the "London group" should be up, next the second highest salary group and so on.

This is my current script: https://pastebin.com/KkwYcmNG

Hope you can help me out here! I tried to built an example in jsfiddle, but I wasn't able to get the custom rendering example running on jsfiddle. If you have a jsfiddle link with this example running I am happy to add all further details of my code.

Thank you so much!

Viewing all 79619 articles
Browse latest View live




Latest Images