Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

echartstest foreign node issue with click routing #82

Closed
gogolxdong opened this issue Dec 21, 2018 · 1 comment
Closed

echartstest foreign node issue with click routing #82

gogolxdong opened this issue Dec 21, 2018 · 1 comment

Comments

@gogolxdong
Copy link
Contributor

gogolxdong commented Dec 21, 2018

type
  clickHandler* = proc():VNode

var view* :clickHandler 

proc click*(x : clickHandler): proc() = 
  result = proc() = view = x

proc echartSection():VNode = 
    buildHtml tdiv(id = "echartSection", style = style((width, kstring"600px"), (height, kstring"400px")))

proc createDom(data: RouterData): VNode =
  let hash = data.hashPart
  if hash == cstring"#/Products": currentView = Products
  else: currentView = Customers

  result = buildHtml(tdiv):
    ul(class = "tabs"):
      for v in low(Views)..high(Views):
        li:
          if v == Products:
              a(href = "#/" & $v, onclick = click echartSection):
                text kstring($v)
          else:
            a(href = "#/" & $v):
              text kstring($v)
    tdiv:
      text "other section"

setRenderer createDom, "ROOT", postRender
setForeignNodeId "echartSection"

got

Uncaught Error: Initialize failed: invalid dom.
    at Object.init (echarts.js:1778)
    at Object.post_render_256045 [as postRenderCallback] (echartstest.js:3454)
    at dodraw_249631 (echartstest.js:2870)
    at HEX3Aanonymous_251001 (echartstest.js:2913)
@gogolxdong gogolxdong changed the title foreign node issue with click routing echarttest foreign node issue with click routing Dec 21, 2018
@gogolxdong gogolxdong changed the title echarttest foreign node issue with click routing echartstest foreign node issue with click routing Dec 21, 2018
@timotheecour
Copy link
Collaborator

wouldn't that run into #287 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants