Advertisement
Guest User

Untitled

a guest
Sep 26th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {
  2.                     view: 'icon',
  3.                     type: 'icon',
  4.                     icon: 'plus-square',
  5.                     tooltip: 'Add',
  6.                     batch: 'dataGrid',
  7.                     click() {
  8.                         let grid = <DataGridView>that.getGrid();
  9.                         let sObject = grid.getObject();
  10.                         let win = <GridWindowView>webix.ui(grid.recordEditWindow);
  11.                         if (!sObject) {
  12.                             webix.message({
  13.                                 text: 'Please select an Object',
  14.                                 type: 'error',
  15.                                 expire: 3000
  16.                             });
  17.                             return;
  18.                         }
  19.                         win.CF_grid = grid;
  20.                         win.show();
  21.  
  22.                         let closeCallback = (reloadData) => {
  23.                             win.close();
  24.                             if (reloadData) {
  25.                                 grid.loadViewData();
  26.                             }
  27.                         };
  28.                         let renderCallback = () => {
  29.                             win.resize();
  30.                         };
  31.                         grid.loadEditRecordComponent(
  32.                             grid.getObject(),
  33.                             null,
  34.                             'recordEditComponentContainer',
  35.                             'recordEditComponentMessage',
  36.                             closeCallback,
  37.                             renderCallback
  38.                         );
  39.  
  40.                     }
  41.                     /*click() {
  42.                         let grid = <DataGridView>that.getGrid();
  43.                         let recId = grid.add({
  44.                             id: `-${webix.uid()}`,
  45.                             Id: this.NEW_ID
  46.                         }, 0);//add blank record to the top
  47.                         let defaults = (<DataGridConfig>grid.config).CF_addRecordDefaults;
  48.                         for (let val in defaults) {
  49.                             grid.processCellUpdate(null, defaults[val], recId, val);
  50.                         }
  51.  
  52.                     },*/
  53.                 },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement