how to put column with button to view more attributes of a row.

how to put column with button to view more attributes of a row.

romeucamurcaromeucamurca Posts: 5Questions: 1Answers: 0

I'm new to datatables and I'm having trouble getting the button to show more details of a line.

This question has accepted answers - jump to:

Answers

  • kthorngrenkthorngren Posts: 21,147Questions: 26Answers: 4,918
    Answer ✓

    Are you trying to build this example?
    https://datatables.net/examples/api/row_details.html

    Maybe you can provide a link to your page or a test case so we can see what you are doing.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

  • romeucamurcaromeucamurca Posts: 5Questions: 1Answers: 0

    Yes, this! I was trying to do this example, but I was not finding on the website how to do it, thanks!

  • romeucamurcaromeucamurca Posts: 5Questions: 1Answers: 0

    another question if possible, is the ajax file in the example a .js or .txt extension?

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    If you mean this:

            "ajax": "../ajax/data/objects.txt",
    

    then why are you asking?
    If you mean something else, please explain.

  • romeucamurcaromeucamurca Posts: 5Questions: 1Answers: 0

    it's because I'm doing this example and I'm leaving all files in one folder and the ajax file looks like this => "ajax": "objects.txt", and looking at the console I can see this error, I tried to use the datatables debugger to help more I couldn't use it.

    error:
    Access to XMLHttpRequest at 'file:///home/romeu/%C3%81rea%20de%20Trabalho/Teste%20do%20Datatables/objects.txt?_=1591483242039' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.

  • kthorngrenkthorngren Posts: 21,147Questions: 26Answers: 4,918
    Answer ✓

    For security reasons web browsers aren't allowed to pull files directly form the local file system. You will need to use a web server to serve the files.

    Kevin

  • romeucamurcaromeucamurca Posts: 5Questions: 1Answers: 0

    ah ok, thanks.

This discussion has been closed.