Question

I have this table structure:

<table class="x-toolbar-ct">
    <tbody>
        <tr>
            <td>col1</td>
            <td>col2</td>
        </tr>
    </tbody>
</table>

No luck with this code:

var row = Ext.select('.x-toolbar-ct').select('tbody').select('tr');
row.appendChild('<td>col3</td>');

So how to append new <td> element? Thank you.

Was it helpful?

Solution

We have to use createChild(), and use first() to return the first element.

var row = Ext.select(".x-toolbar-ct").first().first().first();
row.createChild("<td>col3</td>");
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top