Having Issues with Laravel blade & render() datatables css gone if used with these two

Having Issues with Laravel blade & render() datatables css gone if used with these two

salil93salil93 Posts: 12Questions: 2Answers: 0

I am Working on project build with php Laravel for some reasons i cant get my laravel table to run properlly,So We have used datatables insteed but we are having issues with render() if i remove render() my css of all table is gone including search box paggination etc but if i let it on my page its getting issues with laravell footer calling the footer is hidden....Is thier any issues with the blade view & render view...Plz Suggest any solution...Thank you in advance

Answers

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin

    We'd need a link to the page showing the issue, so it can be debugged, as noted in the forum rules.

    Thanks,
    Allan

  • salil93salil93 Posts: 12Questions: 2Answers: 0

    Sorry I m New to it so didnt know the rules....Here's my Code plz check it as i cant find the error...here if i remove or change the possition of render it removes the css of the datatables but in that case i can see my footer & if i dont change or remove render() my footer and other funtions are not working ..plz suggest any solution
    My Code:-

    Code http://www.drramjasshospital.com/testcheck.txt

    Check the issue http://drramjasshospital.com/showeventstopatient

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin

    The second links shows a DataTable with, what appears to be, correct styling. Is that what you expect? Can you also link to another page, one which shows the error, so it can be debugged. The page with the styling will be a useful reference page to see what the difference is.

    Allan

  • salil93salil93 Posts: 12Questions: 2Answers: 0

    Hello Alan Thanks for replying...yes i want the same format ie Search box, Pagination and the same table css like on the above page....

    U can visit my site where i have used it http://www.drramjasshospital.com

    Login with my id -
    tester21893@gmail.com
    Pass - 123456

    Here U can see that
    On page

    EVENTS IN NAVBAR - VEIW EVENTS & EVENTS REGISTRATION

    i have used datatables ie they are using rendor in the code below footer thats why i am not able to view footer on these pages

    But where i havent used datatables like on these pages HOME & APPOINTMENT TABS IN NAVBAR ,APPOINTMENT TAB - BOOK AN APPOINTMENT i can see my footer i have read about it about having issues of render() & laravel blade veiw i am removing the render from page Appointment (after u r logged in) select the option in

    APPOINMENT TAB - APP STATUS
    here on this page i have removed & replaced the render below @footer now its showing my footer but css of datatables like search box & pagination has gone

    You can the error on that page - 1

    FatalErrorException in f7a05becebea6a8abeddd34ebdd886059d5470d7.php line 96:
    Call to a member function render() on a non-object
    in f7a05becebea6a8abeddd34ebdd886059d5470d7.php line 96

    plz check the issue thank you in advance

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin

    Thanks - I'll take a look when I'm back from travelling, which will be later this week.

    Allan

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin

    Looking that the HTML ("View source") on the registeredevents page the HTML is very broken:


    <div class="container"> <div class="row"> <div class="table-responsive"> <table id="historyTable" class="display compact" cellspacing="0" width="100%"> <thead> <tr> <th>Event Id</th> <th>Event Name</th> <th>Event Description</th> <th>From</th> <th>To</th> <th>Doctor Name</th> <th>Patient Name</th> <th>Number Of Persons</th> <th>Amount</th> <th>Payment Mode</th> </tr> </thead> <tbody > <!-- <!DOCTYPE html> <html> <head> <meta name="robots" content="noindex,nofollow" /> <style> ...

    Is it possible the wrong template is being included in the tbody? Certainly the HTML contains no closing tbody or table. If you pass it through the W3C validator it will show a large number of errors.

    Allan

  • salil93salil93 Posts: 12Questions: 2Answers: 0

    First of all sorry for my late reply...Yes you are correct a page is being called on it just after i have used the render tag <?php echo $data->render(); ?> this render function...which causes a new page just after it..it can be seen in google inspect element which causes my footer and other closing tags after it disappears it is showing the below page on it I dont know what to do if i remove render my css goes with it of datatables but my below elements can be seen in that condition if not thier is css but below contents disappear..plz Suggest anything

    <body>

    <link rel="stylesheet" href="https://cdn.datatables.net/1.10.11/css/jquery.dataTables.min.css">

    $(document).ready(function(){ $('#appointmentTable').dataTable(); });
    [ Here After this tag opens i have placed <?php echo $data->render(); ?> this render function...which causes a new page just after it..it can be seen in google inspect element which causes my footer and other closing tags after it disappears it is showing the below page on it ] #Here the hidden page is being displayed after which all my contents below goes due to lenght writing in parts#
    Event IDEvent DetailsEvent DescriptionFrom DateTo DateDoctor DetailsAmountAction
    149 Vaccination for cancer patients 2016-03-26 2016-03-28 Dr. Seema Parikh 125 Edit| Delete| Repeat| Add Doctors
    Showing 1 to 10 of 47 entries

    </body>

  • salil93salil93 Posts: 12Questions: 2Answers: 0
    edited June 2016

    Hidden page is here ---

    <!DOCTYPE html>
    <html>
        <head>
            <meta name="robots" content="noindex,nofollow" />
            <style>
                /* Copyright (c) 2010, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.com/yui/license.html */
                html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup{vertical-align:text-top;}sub{vertical-align:text-bottom;}input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit;}input,textarea,select{*font-size:100%;}legend{color:#000;}
                html { background: #eee; padding: 10px }
                img { border: 0; }
                #sf-resetcontent { width:970px; margin:0 auto; }
                            .sf-reset { font: 11px Verdana, Arial, sans-serif; color: #333 }
                .sf-reset .clear { clear:both; height:0; font-size:0; line-height:0; }
                .sf-reset .clear_fix:after { display:block; height:0; clear:both; visibility:hidden; }
                .sf-reset .clear_fix { display:inline-block; }
                .sf-reset * html .clear_fix { height:1%; }
                .sf-reset .clear_fix { display:block; }
                .sf-reset, .sf-reset .block { margin: auto }
                .sf-reset abbr { border-bottom: 1px dotted #000; cursor: help; }
                .sf-reset p { font-size:14px; line-height:20px; color:#868686; padding-bottom:20px }
                .sf-reset strong { font-weight:bold; }
                .sf-reset a { color:#6c6159; cursor: default; }
                .sf-reset a img { border:none; }
                .sf-reset a:hover { text-decoration:underline; }
                .sf-reset em { font-style:italic; }
                .sf-reset h1, .sf-reset h2 { font: 20px Georgia, "Times New Roman", Times, serif }
                .sf-reset .exception_counter { background-color: #fff; color: #333; padding: 6px; float: left; margin-right: 10px; float: left; display: block; }
                .sf-reset .exception_title { margin-left: 3em; margin-bottom: 0.7em; display: block; }
                .sf-reset .exception_message { margin-left: 3em; display: block; }
                .sf-reset .traces li { font-size:12px; padding: 2px 4px; list-style-type:decimal; margin-left:20px; }
                .sf-reset .block { background-color:#FFFFFF; padding:10px 28px; margin-bottom:20px;
                    -webkit-border-bottom-right-radius: 16px;
                    -webkit-border-bottom-left-radius: 16px;
                    -moz-border-radius-bottomright: 16px;
                    -moz-border-radius-bottomleft: 16px;
                    border-bottom-right-radius: 16px;
                    border-bottom-left-radius: 16px;
                    border-bottom:1px solid #ccc;
                    border-right:1px solid #ccc;
                    border-left:1px solid #ccc;
                }
                .sf-reset .block_exception { background-color:#ddd; color: #333; padding:20px;
                    -webkit-border-top-left-radius: 16px;
                    -webkit-border-top-right-radius: 16px;
                    -moz-border-radius-topleft: 16px;
                    -moz-border-radius-topright: 16px;
                    border-top-left-radius: 16px;
                    border-top-right-radius: 16px;
                    border-top:1px solid #ccc;
                    border-right:1px solid #ccc;
                    border-left:1px solid #ccc;
                    overflow: hidden;
                    word-wrap: break-word;
                }
                .sf-reset a { background:none; color:#868686; text-decoration:none; }
                .sf-reset a:hover { background:none; color:#313131; text-decoration:underline; }
                .sf-reset ol { padding: 10px 0; }
                .sf-reset h1 { background-color:#FFFFFF; padding: 15px 28px; margin-bottom: 20px;
                    -webkit-border-radius: 10px;
                    -moz-border-radius: 10px;
                    border-radius: 10px;
                    border: 1px solid #ccc;
                }
            </style>
        </head>
        <body>
                        <div id="sf-resetcontent" class="sf-reset">
                    <h1>Whoops, looks like something went wrong.</h1>
                                            <h2 class="block_exception clear_fix">
                                <span class="exception_counter">1/1</span>
                                <span class="exception_title"><abbr title="Symfony\Component\Debug\Exception\FatalErrorException">FatalErrorException</abbr> in <a title="/home/shilpa/public_html/doctorapp/storage/framework/views/b75d0de3d5776e87dc2e44e12a88b4929d9d5e35.php line 113" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">b75d0de3d5776e87dc2e44e12a88b4929d9d5e35.php line 113</a>:</span>
                                <span class="exception_message">Call to a member function render() on a non-object</span>
                            </h2>
                            <div class="block">
                                <ol class="traces list_exception">
           <li> in <a title="/home/shilpa/public_html/doctorapp/storage/framework/views/b75d0de3d5776e87dc2e44e12a88b4929d9d5e35.php line 113" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">b75d0de3d5776e87dc2e44e12a88b4929d9d5e35.php line 113</a></li>
        </ol>
    </div>
    
                </div>
        </body>
    </html>
    

    Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin

    If you link to the page I'll be happy to look over it. I'm afraid I don't see the issue from the above.

    Allan

  • salil93salil93 Posts: 12Questions: 2Answers: 0

    http://drramjasshospital.com/showeventstopatient here it is you can see the source code by inspecting element i have written the code and enclosed all the tables and tags but after <?php echo $data->render(); ?> rendering the page it removes below tags and place its own code above

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin

    It still appears to have the issue we discussed above. There is another HTML page embedded into it. Did you validate it with the W3C validator?

    DataTables will only operate correctly with valid HTML code.

    Allan

  • salil93salil93 Posts: 12Questions: 2Answers: 0

    Sorry For the late reply's yes You are right...i have that page comming up aint created by me its the rendered page comming up which is only being showed up in google inspect element and below table all the divs or any thing i have created is being cleared insteed the blank is shown....As You told i have tried w3 validations but not effective the page still got the error... i just dont understand what the problem is with it...Please suggest anything

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin

    If you "view source" on your page, you can copy the HTML and paste it directly into the W3C Validator. It is showing at least 10 errors. I would suggest you fix them before anything else.

    Allan

  • salil93salil93 Posts: 12Questions: 2Answers: 0

    Thanks Allan for the review...I have checked the errors with w3 validation...but due to the html5 use in my website many tags were not supported as w3 validators currently not support html5...still i check it and will remove all the errors and check if its working....thanks allan again

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin

    The W3C validator supports HTML5 just fine. Your document isn't actually a valid HTML5 document - it doesn't start with <!doctype html> to indicate that it is an HTML5 document for example. The first tag must be <html> - but in your document it is <meta>. There is no closing </html>, or event </body> .

    There are a lot of HTML errors there I'm afraid and DataTables is currently only supported with valid HTML.

    Allan

  • salil93salil93 Posts: 12Questions: 2Answers: 0

    Okay Thank you alan i'll check for it...

  • salil93salil93 Posts: 12Questions: 2Answers: 0
    edited August 2016

    Hey Alan thanks for your help got the issue resolved it was due to the colliding of two scripting functions ie my render function ie <?php echo $data->render(); ?> which causes the whole part of code beaneth it disapperar and the upto top button script ie



    <noscript>Not seeing a <a href="#">Scroll to Top Button</a>? Go to our FAQ page for more info.</noscript> these were the issue thanks for your time on this problem...

This discussion has been closed.