Cannot read property 'style' of undefined

Cannot read property 'style' of undefined

iviryxavyeriviryxavyer Posts: 2Questions: 1Answers: 0

I have this Issue, I read the others asking the same and I check their cases and the mine I don't know why isn't working.

HTML structure

 <div class="modal-body" style="padding:0">
                            <div id="DIV3" class="col-lg-12">

                                <table id="OriginsTBL" class="table table-hover" >

                                    <thead>
                                        <tr>
                                            <th>Origin_ID</th>
                                            <th>Origin</th>
                                      
                                        </tr>
                                    </thead>
                                    <tbody class="cuerpoDatosTabla">
                                    </tbody>
                                </table>
                            </div>
                        </div>

This is the datatables structure columns:

nColumns = [
                { data: 'Origin_ID' },
                { data: 'Origin' }

            ];

This is the json response from the C# controller throught ajax call:


{ "data": [ { "Origin_ID": "1", "Origin": "AFRICA" }, { "Origin_ID": "26", "Origin": "ALABAMA" }, { "Origin_ID": "27", "Origin": "ALASKA" }, { "Origin_ID": "137", "Origin": "ALBERTA" }, { "Origin_ID": "165", "Origin": "AMSTERDAM" }, { "Origin_ID": "249", "Origin": "ANSAN" },

It´s a bootstrap modal, on the same page I have others tables, and others 2 modals this modals doesn't have problems, only this one.

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,303Questions: 26Answers: 4,947
    Answer ✓

    The info you provided looks like it should work. There must be something you haven't provided that is causing the issue. Can you link to a page showing the issue?

    If not please provide debugger output.
    https://datatables.net/manual/tech-notes/10

    Kevin

  • iviryxavyeriviryxavyer Posts: 2Questions: 1Answers: 0

    OK, it was my mistake, the structure of the HTML modal was the problem, a

    close tag was missed on the modal popup.
    Thanks for your help.

This discussion has been closed.