bwu_datagrid setColumns dynamically deforms while

2019-06-02 07:53发布

问题:

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.