小编aut*_*tic的帖子

无法使用HandsOnTable删除行

我无法删除最新版本的行.我正在使用版本0.9.9.

这就是我做的:

var $container = $("#add-table");
$container.handsontable(options);

var handsontable = $container.data('handsontable');
var data = handsontable.getData();
if(data.length > 1 && handsontable.isEmptyRow(data.length-1)) {
    handsontable.alter('remove_row', parseInt(data.length-1));
}
Run Code Online (Sandbox Code Playgroud)

Handsontable上有一个类似的问题删除了多行,但这并没有解决我的目的.此链接上的小提琴不适用于所提供的解决方案.

任何帮助,将不胜感激.

jquery handsontable

7
推荐指数
1
解决办法
1万
查看次数

秋田收藏服务中的SyncCollection太贵了?

我有一个CollectionService()关于akita-ng-fire模块中可用方法的查询。我创建了一个扩展 CollectionService() 的服务,并使用 syncCollection 来维护 Firestore 文档和我的 Web 客户端之间的同步。这是服务定义的样子:

@Injectable({providedIn: 'root'})
@CollectionConfig({path: 'someDoc/:customId/anotherDoc'})
export class MyService extends CollectionService<WorkspaceState> {

    constructor(store: WorkspaceStore) {
        super(store);
        this.store.setHasCache(true, {restartTTL: true});
    }

    // service methods ......
}
Run Code Online (Sandbox Code Playgroud)

onInit在组件的指令中使用它来初始化同步。

    ngOnInit() {
        this.sub = this.myService.syncCollection().pipe(
            concatMap(_ => this.query.myDoc$.pipe(
                tap(d => this.myService.markActive(d.customId)),
                tap(d => this.customId = d.customId),
            )),
            tap(d => this.router.navigate(['somePlace', d. customId])),
        ).subscribe();
    }
Run Code Online (Sandbox Code Playgroud)

但是,我看到此同步每分钟读取约 5 次。有没有办法减少这种情况?我觉得这对我来说很昂贵,因为我们将此服务作为核心服务,用于保持与业务关键文档的同步。

来自社区的任何建议都会有所帮助

firebase angular google-cloud-firestore angular-akita

1
推荐指数
1
解决办法
314
查看次数