本文整理匯總了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())