igniteui-react-grids
Version:
Ignite UI React grid components.
85 lines (84 loc) • 2.36 kB
JavaScript
import { CellKey as CellKey_internal } from "./CellKey";
import { IgrPrimaryKeyValue } from './igr-primary-key-value';
import { IgrDataGridColumn } from './igr-data-grid-column';
/**
* An indentifier for a specific cell in the grid.
*/
export class IgrCellKey {
get i() {
return this._implementation;
}
onImplementationCreated() {
}
constructor() {
this._implementation = new CellKey_internal();
this._implementation.externalObject = this;
}
_provideImplementation(i) {
this._implementation = i;
this._implementation.externalObject = this;
this.onImplementationCreated();
}
/**
* Gets or sets the primary key of the row associated with the cell.
*/
get primaryKey() {
if (this.i.primaryKey == null) {
return null;
}
if (!this._primaryKey) {
this._primaryKey = new IgrPrimaryKeyValue(this.i.primaryKey.key, this.i.primaryKey.value);
}
return this._primaryKey;
}
set primaryKey(v) {
this.i.primaryKey = v.i;
}
/**
* Gets or sets the row data object associated with the cell.
*/
get rowItem() {
return this.i.h;
}
set rowItem(v) {
this.i.h = v;
}
/**
* Gets or sets the column name associated with the cell.
* All columns in the grid must have a unique name. That unique name is what is used for this property.
*/
get columnUniqueKey() {
return this.i.j;
}
set columnUniqueKey(v) {
this.i.j = v;
}
/**
* Gets or sets the resolved column object associated with this cell.
*/
get resolvedColumn() {
const r = this.i.b;
if (r == null) {
return null;
}
if (!r.externalObject) {
let e = IgrDataGridColumn._createFromInternal(r);
if (e) {
e._implementation = r;
}
r.externalObject = e;
}
return r.externalObject;
}
findByName(name) {
if (this.findEphemera) {
if (name && name.indexOf("@@e:") == 0) {
return this.findEphemera(name);
}
}
if (this.primaryKey && this.primaryKey.name && this.primaryKey.name == name) {
return this.primaryKey;
}
return null;
}
}