當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript main.GridApi類代碼示例

本文整理匯總了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);
    }
  }
開發者ID:stajics,項目名稱:poslovna_informatika,代碼行數:12,代碼來源:grid.service.ts

示例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);
    }
  }
開發者ID:stajics,項目名稱:poslovna_informatika,代碼行數:13,代碼來源:grid.service.ts

示例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);
   });
 }
開發者ID:stajics,項目名稱:poslovna_informatika,代碼行數:11,代碼來源:grid.service.ts

示例4: refreshView

 refreshView(gridApi: GridApi) {
   gridApi.refreshView();
 }
開發者ID:stajics,項目名稱:poslovna_informatika,代碼行數:3,代碼來源:grid.service.ts

示例5: updateSelected

 //Set selected element in store
 updateSelected(gridApi: GridApi, _owner) {
   this._store.dispatch({type: 'SELECT_ELEMENT', payload: {data: gridApi.getSelectedRows()[0], owner: _owner}});
 }
開發者ID:stajics,項目名稱:poslovna_informatika,代碼行數:4,代碼來源:grid.service.ts

示例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;
    }
開發者ID:grupopzm,項目名稱:ag-grid-enterprise,代碼行數:27,代碼來源:contextMenu.ts

示例7:

 action: ()=> this.gridApi.showToolPanel(!this.gridApi.isToolPanelShowing())
開發者ID:grupopzm,項目名稱:ag-grid-enterprise,代碼行數:1,代碼來源:contextMenu.ts


注:本文中的ag-grid/main.GridApi類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。