bwu_datagrid setColumns dynamically deforms while running as JS

那年仲夏 提交于 2019-12-08 04:53:06

问题


I was able to dynamically update the columns/data by using something like this:

void setDV(List<Column> cols, List<DataItem> datum) {
    print('setColnData cols.length: ${columns.length}, datum.length: ${data2.length}');
    this.data2.clear();
    print("--1: ${data2.length}");
    if(this.columns.length < 1){
      this.columns = cols;
      grid.setColumns = columns;
    }
    datum.forEach((e) => this.data2.add(e));
    print("--2: ${data2.length}");
    grid.invalidate();
  }

Which works in Chromium flawlessly as a Dart app. I'm able to pass new columns with different renderers, properties, etc. But, If I run my project as JS, it works just as expected on Chrome and it fails in both FireFox and Safari. All the columns appear scrounged up and the top headers are all gone. (I have a picture, but I lack the pointage to post it here).

Also, I'm including 'dart_support.js' on my entrypoint, because without it bwu_datagrid would not show up while running as JS.

I guess my questions are: A) Am I updating the columns/data incorrectly? B) Is this expected behavior for now... C) I overlooked a small detail somewhere.

Thanks in advanced for any help anyone can provide.

来源:https://stackoverflow.com/questions/26856303/bwu-datagrid-setcolumns-dynamically-deforms-while-running-as-js

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!