hello2008
8 Dec 2009, 6:52 PM
I want to use Ext Core API to write a test fn named table.
...
"table": function(){
// in a 40-iteration for loop:
// create a table with the class "madetable", and append it to the DOM
// add a row with one cell to the table. the cell content should be "first"
// add a new cell before the first cell in the row.
//
// return the length of the query "tr td"
},
...
// jquery version for reference
...
"table": function(){
for(var i = 0; i < 40; i++){
$("<table class='madetable'></table>")
.appendTo("body")
.html("<tr><td>first</td></tr>")
.find("tr").prepend("<td>before</td>");
}
return $("tr td").length;
},
...
I found it's not easy for me to write a ext core version of jquery equiv.:)
some requirements:
write a simple and concise fn, shortest is best
only write codes within function body
Ext Core API only, don't use any Ext.apply/applyIf/override/extend
...
"table": function(){
// in a 40-iteration for loop:
// create a table with the class "madetable", and append it to the DOM
// add a row with one cell to the table. the cell content should be "first"
// add a new cell before the first cell in the row.
//
// return the length of the query "tr td"
},
...
// jquery version for reference
...
"table": function(){
for(var i = 0; i < 40; i++){
$("<table class='madetable'></table>")
.appendTo("body")
.html("<tr><td>first</td></tr>")
.find("tr").prepend("<td>before</td>");
}
return $("tr td").length;
},
...
I found it's not easy for me to write a ext core version of jquery equiv.:)
some requirements:
write a simple and concise fn, shortest is best
only write codes within function body
Ext Core API only, don't use any Ext.apply/applyIf/override/extend