我无法删除最新版本的行.我正在使用版本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上有一个类似的问题删除了多行,但这并没有解决我的目的.此链接上的小提琴不适用于所提供的解决方案.
任何帮助,将不胜感激.
我有一个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 次。有没有办法减少这种情况?我觉得这对我来说很昂贵,因为我们将此服务作为核心服务,用于保持与业务关键文档的同步。
来自社区的任何建议都会有所帮助