Class tag doesn't seem to be doing anything

Class tag doesn't seem to be doing anything

PThorrezPThorrez Posts: 8Questions: 2Answers: 0

Hello, jscript noob here.

I've been trying to use Datatables and I've run across an issue where changing the class of the table doesn't seem to do anything.

I have an aspx page calling a method that gets the data from SQL, data shows correctly, references to jquery and datatables js look fine, css seem to be used but I don't get the hover and one in everyline with a different background colour.

Any idea of what it could be?

Worth noting that I'm on IE9 and can't seem to be able to use firefox/chrome so I can't check if it's because of that.

Thanks in advance for any clue.

Answers

  • allanallan Posts: 61,971Questions: 1Answers: 10,160 Site admin

    Thanks for your question - however, per the forum rules can you link to a test case showing the issue please. This will allow the issue to be debugged.

    Information on how to create a test page, if you can't provide a link to your own page can be found here.

    Thanks,
    Allan

  • PThorrezPThorrez Posts: 8Questions: 2Answers: 0

    Unfortunatly, I can't do that.

    But it really is just the typical use case. Reading in a table, building the html table and displaying it. Half the css seem to be missing or something.

    Thanks anyway and sorry for the mistake.

  • allanallan Posts: 61,971Questions: 1Answers: 10,160 Site admin

    All I can really suggest is that you use the download builder which will include all of the required CSS files for you.

    Allan

  • PThorrezPThorrez Posts: 8Questions: 2Answers: 0
    edited January 2017

    I've actually just downloaded the nuget package, shouldn't everything be there?

    I've tried changing paging for instance, like removing it, and it's removed.

    Will try the download thingie...

    edit: OK I've found the "full" version as a nugget and I still get the half styling thing... Is there somewhere some kind of really basic tutorial to make it work? Like which js and css to include in the aspx/html page and how to do it?

  • allanallan Posts: 61,971Questions: 1Answers: 10,160 Site admin

    The NuGet package isn't maintained by myself and isn't an official part of the DataTables project, so I'm not sure what is included in it or how it is packages.

    Allan

  • kthorngrenkthorngren Posts: 20,423Questions: 26Answers: 4,794

    Is there somewhere some kind of really basic tutorial to make it work? Like which js and css to include in the aspx/html page and how to do it?

    Go to the Examples link. Each example provides details of which JS and CSS to include.

    Kevin

  • PThorrezPThorrez Posts: 8Questions: 2Answers: 0
    edited January 2017

    It's what I've done.

  • PThorrezPThorrez Posts: 8Questions: 2Answers: 0
    edited January 2017

    OK, tried using the download manager again and added the two lines it tells me to include and I still get this error when I execute my page:

    Unhandled exception at line 14, column 29928 in http://localhost:57893/DataTables/datatables.min.js

    0x800a01b6 - Microsoft JScript runtime error: Object doesn't support property or method 'addEventListener'

    edit: oh this one was due to the compatibility mode, added <meta http-equiv="X-UA-Compatible" content="IE=edge"> tag and now it loads, but still css isn't applied correctly...

  • allanallan Posts: 61,971Questions: 1Answers: 10,160 Site admin

    Thanks for the update.

    Regarding the CSS we'd need to be able to see the page.

    Allan

  • PThorrezPThorrez Posts: 8Questions: 2Answers: 0
    edited February 2017

    Here's the resulting table in ie9 during debug (I've removed the data but the tags are at their places), I have the paging and filter features but the look is bare. Does it help?

    [code]
    <!DOCTYPE html>

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head><title>
    :(((
    </title><meta http-equiv="X-UA-Compatible" content="IE=edge" /><link rel="stylesheet" type="text/css" href="DataTables/datatables.min.css" />
    <script type="text/javascript" src="DataTables/datatables.min.js"></script>
    <script type="text/javascript">
    $(document).ready(function () {

            $('#MyTable').DataTable();
    
        });
    </script>
    

    </head>
    <body>
    <form method="post" action="default.aspx" id="form1">

        <div>            
            <table style="width:100%;" class="display" id="MyTable" >
    
                <thead><tr><td>... header info - column names</td></tr></thead><tbody><tr><td>table data</td></tr></tbody>
    
            </table>
        </div>
    </form>
    

    </body>
    </html>
    [/code]

  • allanallan Posts: 61,971Questions: 1Answers: 10,160 Site admin

    We'd really need a link to the page please. JSFiddle, JSBin or similar can be used if you can't link to your page.

    Allan

  • PThorrezPThorrez Posts: 8Questions: 2Answers: 0

    I really don't understand those tools...

This discussion has been closed.