Giter VIP home page Giter VIP logo

Comments (6)

Janther avatar Janther commented on June 4, 2024

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.

metaskills avatar metaskills commented on June 4, 2024

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.

Janther avatar Janther commented on June 4, 2024

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.

metaskills avatar metaskills commented on June 4, 2024

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.

Janther avatar Janther commented on June 4, 2024

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.

Janther avatar Janther commented on June 4, 2024

Solved in pull request #34

from space-pen.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.