File-size

File-size

goldygoldy Posts: 20Questions: 11Answers: 0

I'm having all sorts of issues getting this working.. My units are KB, GB, MB
So exampel, 1.4MB 8.0GB, 9.0KB

Here is my html
"columnDefs": [{
type: file-size, "targets": -3,

           "width": "15%", "targets": -5 ,
}],

any help in the right direction would be great

Answers

  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin

    Can you link to the page (as noted in the forum rules) please so we can debug it?

    type: file-size

    Would be surprised if you are not getting a syntax error there. file-size should be a string (i.e. in quotes).

    Allan

  • goldygoldy Posts: 20Questions: 11Answers: 0

    Allan - I would love to post but it's on an internal page so I can't sanitize the data and post it externally

    Just to clarify -

    The code looks like

    "columnDefs": [{
        "type": "file-size", 
        targets: -3,
               "width": "15%", "targets": -5 ,
    }],
    
  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin

    Looks like it should work to me. Without a test case, I can't say why that isn't working.

    Allan

  • goldygoldy Posts: 20Questions: 11Answers: 0

    Allan - I would have to mail you a few lines of code b/c I can't post publically

  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin

    You can drop me a PM by clicking my name above and then "Send Message". A running example showing the issue (perhaps posted on http://live.datatables.net , JSFiddle or CodePen) would be best.

    Allan

This discussion has been closed.