保存或任何其他操作后,Ember表不会更新

时间:2016-07-08 06:14:36

标签: ember.js ember-data ember-cli

我将一个简单的表用于ember,当它保存在数据库中的任何记录时。

但是对表格没有任何影响我必须点击排序图标才能看到更改。

表格代码

{{#simple-table class="table table-hover" tData=refbody tColumns=headerConfig as |table|}}
{{#table.header-row as |row column|}}
    <div class="th-inner">
        {{#each (get row column) as |cell|}}
        {{#if cell}}
        <span>{{cell}} <i class="sort-arrow"></i></span>
        {{/if}}
        {{/each}}
    </div>
    {{/table.header-row}}

    {{#table.body as |row|}}
        {{reference-row record=row type=param action="updateEmployee"}}
    {{/table.body}}
{{/simple-table}}

Rout代码

saveempRcd: function (empRcd) {

        if(this.isValidRecord(empRcd, empRcd.get('employee'))){
            this.controller.set('loader', true);
            empRcd.save().then(() => {
                this.store.unloadAll();
                return this.store.findRecord('employee-list', 1).then((response) => {
                    this.get('notify').success("Successfully saved");
                    return this.controllerFor('employee').set('cEmpData', response);
                });
            }).catch((exception) => {
                this.get('notify').alert({
                    html: this.get('errorFormatter').formatErrorNotification(exception),
                    closeAfter: null
                });
            }).finally(() => {
                this.controller.set('loader', false);
                this.transitionTo("employee");
            });
        } else {
            this.controller.set('errorMessage', empRcd.get('validations.messages'));
        }
    },

0 个答案:

没有答案