本文整理汇总了TypeScript中ag-grid/main.GridApi类的典型用法代码示例。如果您正苦于以下问题:TypeScript GridApi类的具体用法?TypeScript GridApi怎么用?TypeScript GridApi使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了GridApi类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: selectPrevious
selectPrevious(gridApi: GridApi) {
//Select first node if none selected
if (gridApi.getSelectedNodes().length === 0) {
gridApi.getModel().getRow(0).setSelected(true, true);
return;
}
let rowIndex = gridApi.getSelectedNodes()[0].childIndex;
if (-1 < rowIndex - 1) {
gridApi.getModel().getRow(rowIndex - 1).setSelected(true, true);
}
}
示例2: selectNext
selectNext(gridApi: GridApi) {
//Select first node if none selected
if (gridApi.getSelectedNodes().length === 0) {
gridApi.getModel().getRow(0).setSelected(true, true);
return;
}
let rowIndex = gridApi.getSelectedNodes()[0].childIndex;
let rowCount = gridApi.getModel().getRowCount();
if (rowCount > rowIndex + 1) {
gridApi.getModel().getRow(rowIndex + 1).setSelected(true, true);
}
}
示例3: selectElement
//select given JSON element
selectElement(gridApi: GridApi, json) {
gridApi.getModel().forEachNode(rowNode => {
for(let key in json){
if(rowNode.data[key].toString() !== json[key].toString()){
return;
}
}
rowNode.setSelected(true, true);
});
}
示例4: refreshView
refreshView(gridApi: GridApi) {
gridApi.refreshView();
}
示例5: updateSelected
//Set selected element in store
updateSelected(gridApi: GridApi, _owner) {
this._store.dispatch({type: 'SELECT_ELEMENT', payload: {data: gridApi.getSelectedRows()[0], owner: _owner}});
}
示例6: createDefaultMenuItems
private createDefaultMenuItems(): {[key: string]: MenuItem} {
var localeTextFunc = this.gridOptionsWrapper.getLocaleTextFunc();
var result: {[key: string]: MenuItem} = {
copy: {
name: localeTextFunc('copy','Copy'),
shortcut: localeTextFunc('ctrlC','Ctrl+C'),
icon: svgFactory.createCopyIcon(),
action: ()=> this.clipboardService.copyToClipboard()
},
paste: {
name: localeTextFunc('paste','Paste'),
shortcut: localeTextFunc('ctrlV','Ctrl+V'),
disabled: true,
icon: svgFactory.createPasteIcon(),
action: ()=> this.clipboardService.pasteFromClipboard()
},
toolPanel: {
name: localeTextFunc('toolPanel', 'Tool Panel'),
checked: this.gridApi.isToolPanelShowing(),
action: ()=> this.gridApi.showToolPanel(!this.gridApi.isToolPanelShowing())
}
};
return result;
}
示例7:
action: ()=> this.gridApi.showToolPanel(!this.gridApi.isToolPanelShowing())