Modal details display - HTML
Modal details display - HTML
daveos
Posts: 19Questions: 4Answers: 0
Is the HTML right in the Modal details display example?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
That's a pretty vague question. What exactly are you questioning?
The HTML seems off:
Maybe you can describe what you are expecting. Just saying it "seems off" doesn't tell us where to look.
Kevin
I'm talking about this:
http://live.datatables.net/bobucayo/1/edit
I just realized it was also included in other examples. Could you explain to me what it does?
I mean I know it's the js in that example, but why include it in an html table like that?
All you did was post the code from the page. The test case doesn't run. Again please specify exactly what you are asking about.
What is "it" that is included in other examples. We want to help but you need to provide specific information.
Kevin
http://live.datatables.net/pixohira/1/edit
I added the comments Part1 and Part2 to explain myself better.
It just confuses me that the JS would be included in the HTML like that. Is it necessary?
This is for the main table.
The
responsive.details.renderer
builds an HTML element to display the modal. Which will be removed when closing the modal. The HTML is needed to display the modal.Kevin
OK I feel like there's huge misunderstanding here.
What I'm trying to say is:
Why is the same js code included in both the HTML tab and the Javascript tab.
Why include the js code in the HTML tab in the first place?
Now I feel bad for creating all this confusion and wasting your time. I just wanted to understand. Thank you for taking the time to answer anyway.
The thing is, I'm trying to use the Modal Details Display on my table http://live.datatables.net/bomitozo/1/edit but it doesn't want to work. So I'm wondering if that js in the HTML (that I haven't included) has something to do with it.
The HTML tab shows the HTML to build the table. Your screenshot shows that it was not rendered properly on your page but its just the HTML for the table. not Javascript code is shown in that tab.
It does work. Your example's width doesn't take much of the display. Depending on the window size it may start like this:
Making the page display smaller causes responsive to kick in and you can click the button to display the modal:
Kevin
Oooh so the HTML tab is only rendered wrong on my browser... I cleared the cache and cookies and it works now. I thought the HTML table was always weird... Sorry about that!
Oh! I did not think of that. So the ModalDetailDisplay only shows when the page is small? What can I do to leave it on at all times?
You have a bunch of columns you are hiding with
columns.visible
. Instead you can use Responsive Classes to hide them so Responsive is always has column hidden and the button is available to click. Like this:http://live.datatables.net/dimebaxu/1/edit
Kevin
You not only cleared up my confusion, but you also helped me solve my problem.
Thank you so much for your time and patience, Kevin!
Glad you got it working BTW, I've seen that HTML tab formatting problem before too.
Kevin