Print / Copy / Excel doesn't print 'selected' option value

Print / Copy / Excel doesn't print 'selected' option value

sam67khannasam67khanna Posts: 4Questions: 1Answers: 0

I am trying to print or copy a table which has 8 columns. I am having 2 issues
1. I am only able to print 7 of them the 8th one goes outside the page. If I reduce the size it becomes very small
2. The very last column is for status (select) and when I print it I see all 4 status being printed instead of just the selected value. NOTE: This selected class doesn't have the same name example <select name="status-2" id="status-2" class="status-select"> I add value ""id to each one of the row to get the option value from DB. You can take a look at **screenshot **for reference

Answers

  • kthorngrenkthorngren Posts: 15,760Questions: 25Answers: 3,736

    See if this thread helps.

    Kevin

  • sam67khannasam67khanna Posts: 4Questions: 1Answers: 0

    Hi Kevin no this thread different I have the values inside a row and I want to print the value of that select that's it. I am not trying to filter or anything else

  • kthorngrenkthorngren Posts: 15,760Questions: 25Answers: 3,736

    Take a look at Colin's example from that thread:
    http://live.datatables.net/kajugomo/1/edit

    For this comment:

    Take a look at this example - the column is being rendered differently in an export. Now, instead of just returning those HTML elements, it uses jQuery to pull out the text.

    Basically he is showing how to use jQuery to get the value of the input in the cell. Also see this example explaining exporting with orthogonal data.

    If you still need help please provide a running test case, or update Colin's, showing an example of your cells with the select inputs.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

  • sam67khannasam67khanna Posts: 4Questions: 1Answers: 0
  • colincolin Posts: 14,185Questions: 1Answers: 2,404

    It looks like you haven't applied the code that Kevin pointed you towards. Take a look at his last reply, that will solve it for you,

    Colin

  • sam67khannasam67khanna Posts: 4Questions: 1Answers: 0

    that code sorts the value I am trying to read the .value of select ID

Sign In or Register to comment.