Cereal Killer
Cereal Killer

Reputation: 3414

Ember parentNode of null error

I'm using jquery dataTable plugin in one Ember view; the template:

    {{#view App.dataTableView}}
        <thead>
            <tr>
                <th>Date</th>
                <th>Name</th>
            </tr>
        </thead>

        <tbody>
            {{#each offer in model.offers}}
                <tr>
                    <td>
                        {{offer.creationDate}}
                    </td>
                    <td>
                        {{#link-to 'offer.edit' offer}}{{offer.name}}{{/link-to}}
                    </td>
                </tr>
            {{/each}}
        </tbody>
    {{/view}}

And the view:

App.dataTableView = Ember.View.extend({
tagName:'table',
didInsertElement: function() {
    this.$().dataTable();
    }
});

After this I get an error while loading saying cannot read property 'parentNode' of null;

The function giving the error is _addMetamorphCheck() in ember.js; as I can understand this function is responsible to close html tags where the user forget to do it; so usually this error occurs when you are using invalid HTML;

but to me my HTML appears to be valid; if i comment the _addMetamorphCheck() function in ember.js, everything works fine.

So, can someone explain to me if I'm doing something wrong? If I leave the _addMetamorphCheck() function commented in ember.js, will I have some troubles?

Upvotes: 0

Views: 740

Answers (1)

panta82
panta82

Reputation: 2721

dataTables itself seems to work fine with Ember, at least in this simple use case: demo.

I think something is wrong elsewhere in your code. Check your model and route.

Upvotes: 1

Related Questions