All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.modules.sys.dictionary.ctrl.dictionary.item.remove.js Maven / Gradle / Ivy

There is a newer version: 5.0.2101
Show newest version
define(function (require) {
  var Page = require('core/page');

  // 删除字典明细
  return Page.extend(function () {

    this.renderButton = function (btn, row) {
      if (row.dataStyle === 'F') {
        return false;
      }

      return this.$findUp('isAdmin') ? true : row.dataStyle !== 'S';
    };

    // @override
    this.submit = function (table, row) {
      // 列表
      if (this.parent.type === 'L') {
        this.removeListItem(table, row);
      }
      else {
        this.removeTreeItem(table);
      }
    };

    // 删除列表明细
    this.removeListItem = function (table, row) {
      var index = table.datagrid('getRowIndex', row);
      table.datagrid('deleteRow', index);
    };

    // 删除树明细
    this.removeTreeItem = function (table) {
      var row = table.treegrid('getSelected');

      if (row) {
        table.treegrid('remove', row._id);
      }

    }
  });

});




© 2015 - 2024 Weber Informatics LLC | Privacy Policy