Comments (6)
I saw maybe too late that the documentation has the View.render method. However when I try:
class TableView extends View
@content: ->
@table =>
@tbody outlet: 'body'
update_rows: (rows) ->
for row in rows
@body.append @row(row)
row: (row) ->
View.render ->
@tr =>
@td row[0]
@td row[1]
I get an error:
TypeError: element[0].getAttribute is not a function
and when using console.log @row(row)
I get Object[<TextNode textContent="12">]
with 1
and 2
being row[0]
and row[1]
from space-pen.
A quick glance, it looks like you have a naming issue with row
. Maybe try this:
class TableView extends View
@content: ->
@table =>
@tbody outlet: 'body'
updateRows: (rows) ->
@body.append @renderRow(row) for row in rows
renderRow: (row) ->
View.render ->
@tr =>
@td row[0]
@td row[1]
from space-pen.
Your comment looked quite promising but i'm still having this issue.
For the moment Im working with the class approach.
By the way I'm using the #29 code since this is supposed to work in any browser.
from space-pen.
This definitely seems like a bug on quite a few elements. For example:
View.render(function(){ return this.span(); }); // [<span></span>]
View.render(function(){ return this.ol(); }); // [<ol></ol>]
View.render(function(){ return this.time(); }); // [<time></time>]
View.render(function(){ return this.tr(); }); // []
View.render(function(){ return this.td(); }); // []
View.render(function(){ return this.tfoot(); }); // []
View.render(function(){ return this.thead(); }); // []
View.render(function(){ return this.tbody(); }); // []
View.render(function(){ return this.col(); }); // []
from space-pen.
My guess is that tables are poorly supported by the standard AKA webkit (not space-pen's problem) and for this to run without an ugly hack would be difficult (and probably hinder the performance).
Sadly our designer is strict on this "Grids are for layouts. Tabulated data belongs to a table."
I'll try to find where the bug happens and see if a solution is possible while keeping the performance level.
from space-pen.
Solved in pull request #34
from space-pen.
Related Issues (20)
- Bower package HOT 8
- Why the dependency on jquery-extensions HOT 5
- Current dependencies HOT 5
- How to <br> ? HOT 2
- @subview in top level of given view HOT 3
- Listener added via View.preempt() cannot be removed. HOT 7
- Simplify removing a listener HOT 1
- Subview appears above table HOT 5
- How apply event click to content add by append? HOT 3
- Getting Started HOT 4
- atom-text-editor in @tag HOT 1
- Can't have an outlet on the top level HOT 1
- Does not play well when multiple versions of spacepen HOT 1
- how to interact with external linked js and execute inline javascript on page HOT 3
- Github pages is out of date HOT 1
- Improper jQuery code HOT 3
- npm install/start failed on windows HOT 2
- attached isn't called HOT 2
- Built-in tags with @tag HOT 1
- "No longer maintained" - more description in Readme? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from space-pen.