Properties

NameTypeDefault
altrows boolean false

Enables or disables the alternating rows.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[altrows]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
altstart number 1

This property specifies the first alternating row.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[altrows]='true' [altstart]='2'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
altstep number 1

Sets or gets the alternating step

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[altrows]='true' [altstart]='0' [altstep]='2'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
autoshowloadelement boolean true

Determines whether the loading image should be displayed until the Grid's data is loaded.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[autoshowloadelement]='false'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
autoshowfiltericon boolean true

Displays the filter icon only when the column is filtered. When the value of this property is set to false, all grid columns will display a filter icon when the filtering is enabled.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[filterable]='true' [autoshowfiltericon]='false'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
autoshowcolumnsmenubutton boolean true

Sets or gets whether the columns menu button will be displayed only when the mouse cursor is over a columns header or will be always displayed.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[filterable]='true' [autoshowcolumnsmenubutton]='false'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
showcolumnlines boolean true

Sets or gets whether the columns lines are displayed.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[showcolumnlines]='false'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
showrowlines boolean true

Sets or gets whether the row lines are displayed.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[showrowlines]='false'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
showcolumnheaderlines boolean true

Sets or gets whether the column header lines are displayed.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[showcolumnheaderlines]='false'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
adaptive boolean false

Sets or gets whether adaptive mode is enabled.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[adaptive]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
compact boolean false

Sets or gets whether compact mode is enabled.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[compact]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
adaptivewidth number 600

Sets or gets the Grid's breakpoint width when adaptive mode is actived.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[adaptive]='true' [adaptivewidth]='400'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
commandcolumn boolean false

Sets or gets whether command column is enabled.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[commandcolumn]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
commandcolumnrenderer (row?: number, columnfield?: string, active?: any) => string
Sets a custom command column rendering function
import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
clipboard boolean true

Enables or disables the clipboard operations

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[clipboard]='false'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
closeablegroups boolean true

When the value of this property is true, a close button is displayed in each grouping column.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[groupable]='true' [groups]='["City"]' [closeablegroups]='false'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
columnsmenuwidth number 15

Sets or gets the columns menu width.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[filterable]='true' [autoshowcolumnsmenubutton]='false' [columnsmenuwidth]='40'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
columnmenuopening (menu?: GridColumnmenuopening['menu'], datafield?: GridColumnmenuopening['datafield'], height?: GridColumnmenuopening['height']) => boolean | void null
Interface GridColumnmenuopening {
  menu?: any;
  datafield?: any;
  height?: number | string;
}

Callback called when a column menu is opening. You can use it for changing the size of the menu or cancelling the opening. Three params are passed - menu, datafield and menu's height. If you return false, the opening will be cancelled.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[columnmenuopening]='columnmenuopening' [filterable]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public columnmenuopening(menu?: any, datafield?: any, height?: number | string): boolean | void {
alert('Menu Opening');
}
}
columnmenuclosing (menu?: GridColumnmenuclosing['menu'], datafield?: GridColumnmenuclosing['datafield'], height?: GridColumnmenuclosing['height']) => boolean null
Interface GridColumnmenuclosing {
  menu?: any;
  datafield?: any;
  height?: number | string;
}

Callback called when a column menu is opening. You can use it for changing the size of the menu or cancelling the opening. Three params are passed - menu, datafield and menu's height. If you return false, the opening will be cancelled.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[columnmenuclosing]='columnmenuclosing' [filterable]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public columnmenuclosing(menu?: any, datafield?: any, height?: number | string): boolean {
alert('Menu Closing');
}
}
cellhover (cellhtmlElement?: GridCellhover['cellhtmlElement'], x?: GridCellhover['x'], y?: GridCellhover['y']) => void null
Interface GridCellhover {
  cellhtmlElement?: any;
  x?: any;
  y?: any;
}

Callback called when a cell is hovered.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[cellhover]='cellhover'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public cellhover(cellhtmlElement?: any, x?: any, y?: any): void {
alert('Cell Hovered!');
}
}
enablekeyboarddelete boolean true

Enables or disables the delete of a cell/row values by using the "delete" key.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[editable]='true' [enablekeyboarddelete]='false'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
enableellipsis boolean true

Determines whether ellipsis will be displayed, if the cells or columns content overflows.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[enableellipsis]='false'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
enablemousewheel boolean true

Determines whether mousewheel scrolling is enabled.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='false'
[height]='100' [enablemousewheel]='false'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
enableanimations boolean true

Enables or disables the grid animations.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[filterable]='true' [enableanimations]='false'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
enabletooltips boolean false

Enables or disables the grid tooltips.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[enabletooltips]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
enablehover boolean true

Enables or disables the grid rows hover state.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[enablehover]='false'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
enablebrowserselection boolean false

Enables the text selection of the browser.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[enablebrowserselection]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
everpresentrowposition GridEverPresentRowPosition 'top'
GridEverPresentRowPosition: "top" | "bottom" | "topAboveFilterRow"

Sets the position of the ever present row. Possible values: "top", "bottom", "topAboveFilterRow".

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[showeverpresentrow]='true' [everpresentrowposition]='"bottom"'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
everpresentrowheight number 30

Sets the height of the ever present row.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[showeverpresentrow]='true' [everpresentrowheight]='40'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
everpresentrowactions string "add reset"

Sets the actions of the ever present row. Possible values: "add", "reset", "update", "delete". Instead of "add", you can also use "addBottom" which is the same as "add", but adds the new row to the bottom of the Grid.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[showeverpresentrow]='true' [everpresentrowactions]='"add update delete reset"'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
everpresentrowactionsmode GridEverPresentRowActionsMode "popup"
GridEverPresentRowActionsMode: "popup" | "columns"

Sets the actions display mode. By default they are displayed in a popup. You can set the property to "columns" and define columns with datafields - addButtonColumn, resetButtonColumn, updateButtonColumn and deleteButtonColumn to display the actions in columns.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]="850" [source]="source" [columns]="columns" [autoheight]="true" [showeverpresentrow]="true"
[everpresentrowactionsmode]="'columns'" >
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' },
{ datafield: 'addButtonColumn', width: 50 },
{ datafield: 'resetButtonColumn', width: 50 }
];
}
filterrowheight number 36

Sets or gets the filter row's height.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[filterable]='true' [showfilterrow]='true' [filterrowheight]='40'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
filtermode GridFilterMode "default"
GridFilterMode: "default" | "excel"

The property specifies the type of rendering of the Filter Menu. Possible values: "default" and "excel". In "excel" mode, the Filter Menu displays a ListBox with Checkboxes with all unique cell values.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[filterable]='true' [filtermode]='"excel"'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
groupsrenderer (text?: GridGroupsrenderer['text'], group?: GridGroupsrenderer['group'], expanded?: GridGroupsrenderer['expanded'], data?: GridGroupsrenderer['data']) => string null
Interface GridGroupsrenderer {
  text?: string;
  group?: number;
  expanded?: boolean;
  data?: object;
}

This function is called when a group is rendered. You can use it to customize the default group rendering.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[groupsrenderer]='groupsrenderer' [groupable]='true' [groups]='["City"]'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public groupsrenderer(text?: string, group?: number, expanded?: boolean, data?: object): string {
return 'City: ' + group;
}
}
groupcolumnrenderer (text?: GridGroupcolumnrenderer['text']) => string null
Interface GridGroupcolumnrenderer {
  text?: any;
}

Sets or gets a custom renderer for the grouping columns displayed in the grouping header when the grouping feature is enabled.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[groupcolumnrenderer]='groupcolumnrenderer' [groupable]='true' [groups]='["City"]'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public groupcolumnrenderer(text?: any): string {
return 'Grouped By: ' + text;
}
}
groupsexpandedbydefault boolean false

Sets or gets the default state of the grouped rows.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[groupable]='true' [groups]='["ContactName"]' [groupsexpandedbydefault]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
handlekeyboardnavigation (event: GridHandlekeyboardnavigation['event']) => boolean null

The function is called when a key is pressed. If the result of the function is true, the default keyboard navigation will be overriden for the pressed key.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[handlekeyboardnavigation]='handlekeyboardnavigation'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public handlekeyboardnavigation(): boolean {
// const key = event.charCode ? event.charCode : event.keyCode ? event.keyCode : 0;
// alert(key);
}
}
pagerrenderer () => any[] null

The function is called when the Grid Pager is rendered. This allows you to customize the default rendering of the pager.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[pagerrenderer]='pagerrenderer' [pageable]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public pagerrenderer(): any[] {
const element = document.createElement('div');
element.innerHTML = 'Custom Render of the JqxGrid Pager!';
return element;
}
}
rtl boolean false

Sets or gets a value indicating whether widget's elements are aligned to support locales using right-to-left fonts.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[rtl]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
showdefaultloadelement boolean true

Determines whether the Grid should display the built-in loading element or should use a DIV tag with class 'jqx-grid-load'

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[showdefaultloadelement]='false'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
showfiltercolumnbackground boolean true

When this property is true, the Grid adds an additional visual style to the grid cells in the filter column(s).

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[filterable]='true' [showfiltercolumnbackground]='false'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
showfiltermenuitems boolean true

Determines whether to display the filtering items in the column's menu.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[filterable]='true' [showfiltermenuitems]='false'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
showpinnedcolumnbackground boolean true

When this property is true, the Grid adds an additional visual style to the grid cells in the pinned column(s).

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]="500" [source]="source" [columns]="columns" [autoheight]="true" [showpinnedcolumnbackground]="false" >
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ pinned: true, text: 'Contact Name', datafield: 'ContactName', width: 150 },
{ text: 'Contact Title', datafield: 'Title', width: 150 },
{ text: 'City', datafield: 'City', width: 150 },
{ text: 'Country', datafield: 'Country', width: 150 },
{ text: 'Country1', width: 150 },
{ text: 'Country2', width: 150 },
{ text: 'Country3', width: 150 },
{ text: 'Country4', width: 150 },
{ text: 'Country5', width: 150 }
];
}
showsortcolumnbackground boolean true

When this property is true, the Grid adds an additional visual style to the grid cells in the sort column.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[sortable]='true' [showsortcolumnbackground]='false'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
showsortmenuitems boolean true

Determines whether to display the sort menu items.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[sortable]='true' [showsortmenuitems]='false'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
showgroupmenuitems boolean true

Determines whether to display the group menu items.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[groupable]='true' [showgroupmenuitems]='false'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
showrowdetailscolumn boolean true

Shows an additional column with expand/collapse toggle buttons when the Row details feature is enabled.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[rowdetails]='true' [showrowdetailscolumn]='false'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
showheader boolean true

Shows or hides the columns header.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[showheader]='false'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
showgroupsheader boolean true

Shows or hides the groups header area.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[groupable]='true' [showgroupsheader]='false'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
showaggregates boolean false

Shows or hides the aggregates in the grid's statusbar.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]="850" [source]="source" [columns]="columns" [autoheight]="true" [showaggregates]="true" [showstatusbar]="true" [statusbarheight]="50">
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{
text: 'Contact Title', datafield: 'Title', aggregates: ['count', {
'Owners': function (aggregatedValue, currentValue) {
if (currentValue == 'Owner') {
return aggregatedValue + 1;
}
return aggregatedValue;
}
}]
},
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country', aggregates: ['count'] }
];
}
showgroupaggregates boolean false

Shows or hides the aggregates in Grid groups.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]="850" [source]="source" [columns]="columns" [autoheight]="true" [groupable]="true"
[showaggregates]="true" [showgroupaggregates]="true" [showstatusbar]="true" [statusbarheight]="50" >
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{
text: 'Contact Title', datafield: 'Title', aggregates: ['count', {
'Owners': function (aggregatedValue, currentValue) {
if (currentValue == 'Owner') {
return aggregatedValue + 1;
}
return aggregatedValue;
}
}]
},
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country', aggregates: ['count'] }
];
}
showeverpresentrow boolean false

Shows or hides an additional row in jqxGrid which allows you to easily add new rows.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[showeverpresentrow]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
showfilterrow boolean false

Shows or hides the filter row.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[filterable]='true' [showfilterrow]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
showemptyrow boolean true

Shows or hides the empty row label when the Grid has no records to display.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]="850" [columns]="columns" [autoheight]="true" [showemptyrow]="false" >
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
]
}
};
}
showstatusbar boolean false

Shows or hides the grid's statusbar.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[showstatusbar]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
statusbarheight number 34

Sets the statusbar's height.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[showstatusbar]='true' [statusbarheight]='50'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
showtoolbar boolean false

Shows or hides the grid's toolbar.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[showtoolbar]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
showfilterbar boolean false

Shows or hides the grid's filter bar.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[showfilterbar]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
filterbarmode string default

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
selectionmode GridSelectionMode 'singlerow'
GridSelectionMode: "none" | "singlerow" | "multiplerows" | "multiplerowsextended" | "singlecell" | "multiplecells" | "multiplecellsextended" | "multiplecellsadvanced" | "checkbox"

Sets or gets the selection mode.

Possible Values:
'none'-disables the selection
'singlerow'- full row selection
'multiplerows' - each click selects a new row. Click on a selected row unselects it
'multiplerowsextended' - multiple rows selection with drag and drop. The selection behavior resembles the selection of icons on your desktop
'singlecell' - single cell selection
'multiplecells' - each click selects a new cell. Click on a selected cell unselects it
'multiplecellsextended' - in this mode, users can select multiple cells with a drag and drop. The selection behavior resembles the selection of icons on your desktop
'multiplecellsadvanced' - this mode is the most advanced cells selection mode. In this mode, users can select multiple cells with a drag and drop. The selection behavior resembles the selection of cells in a spreadsheet
'checkbox' - multiple rows selection through a checkbox.
import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[selectionmode]='"multiplerows"'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
updatefilterconditions (type?: string, defaultconditions?: any) => any null

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]="800" [source]="source" [autoheight]="true" [columns]="columns"
[filterable]="true" [autoshowfiltericon]="true" [ready]="ready"
[updatefilterconditions]="updatefilterconditions" [updatefilterpanel]="updatefilterpanel">
</JqxGrid>,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
addfilter(e: Event): any {
let filtergroup = new jqx.filter();
let filter_or_operator = 1;
let filtervalue = 'Beate';
let filtercondition = 'contains';
let filter1 = filtergroup.createfilter('stringfilter', filtervalue, filtercondition);
filtervalue = 'Andrew';
filtercondition = 'contains';
let filter2 = filtergroup.createfilter('stringfilter', filtervalue, filtercondition);
filtergroup.addfilter(filter_or_operator, filter1);
filtergroup.addfilter(filter_or_operator, filter2);
// add the filters.
this.$refs.myGrid.addfilter('firstname', filtergroup);
// apply the filters.
this.$refs.myGrid.applyfilters();
},
updatefilterconditions(e: Event): any {
let stringcomparisonoperators = ['CONTAINS', 'DOES_NOT_CONTAIN'];
let numericcomparisonoperators = ['LESS_THAN', 'GREATER_THAN'];
let datecomparisonoperators = ['LESS_THAN', 'GREATER_THAN'];
let booleancomparisonoperators = ['EQUAL', 'NOT_EQUAL'];
switch (type) {
case 'stringfilter':
return stringcomparisonoperators;
case 'numericfilter':
return numericcomparisonoperators;
case 'datefilter':
return datecomparisonoperators;
case 'booleanfilter':
return booleancomparisonoperators;
}
},
updatefilterpanel: function (filtertypedropdown1, filtertypedropdown2, filteroperatordropdown, filterinputfield1,
filterinputfield2, filterbutton, clearbutton, columnfilter, filtertype, filterconditions) {
let index1 = 0;
let index2 = 0;
if (columnfilter != null) {
let filter1 = columnfilter.getfilterat(0);
let filter2 = columnfilter.getfilterat(1);
if (filter1) {
index1 = filterconditions.indexOf(filter1.comparisonoperator);
let value1 = filter1.filtervalue;
filterinputfield1.val(value1);
}
if (filter2) {
index2 = filterconditions.indexOf(filter2.comparisonoperator);
let value2 = filter2.filtervalue;
filterinputfield2.val(value2);
}
}
filtertypedropdown1.jqxDropDownList({ autoDropDownHeight: true, selectedIndex: index1 });
filtertypedropdown2.jqxDropDownList({ autoDropDownHeight: true, selectedIndex: index2 });
},
ready(e: Event): any {
this.addfilter();
let localizationObject = {
filterstringcomparisonoperators: ['contains', 'does not contain'],
// filter numeric comparison operators.
filternumericcomparisonoperators: ['less than', 'greater than'],
// filter date comparison operators.
filterdatecomparisonoperators: ['less than', 'greater than'],
// filter bool comparison operators.
filterbooleancomparisonoperators: ['equal', 'not equal']
}
this.$refs.myGrid.localizestrings(localizationObject);
}
}
updatefilterpanel (filtertypedropdown1?: any, filtertypedropdown2?: any, filteroperatordropdown?: any, filterinputfield1?: any, filterinputfield2?: any, filterbutton?: any, clearbutton?: any, columnfilter?: any, filtertype?: any, filterconditions?: any) => any null

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]="800" [source]="source" [autoheight]="true" [columns]="columns"
[filterable]="true" [autoshowfiltericon]="true" [ready]="ready"
[updatefilterconditions]="updatefilterconditions" [updatefilterpanel]="updatefilterpanel">
</JqxGrid>,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
addfilter(e: Event): any {
let filtergroup = new jqx.filter();
let filter_or_operator = 1;
let filtervalue = 'Beate';
let filtercondition = 'contains';
let filter1 = filtergroup.createfilter('stringfilter', filtervalue, filtercondition);
filtervalue = 'Andrew';
filtercondition = 'contains';
let filter2 = filtergroup.createfilter('stringfilter', filtervalue, filtercondition);
filtergroup.addfilter(filter_or_operator, filter1);
filtergroup.addfilter(filter_or_operator, filter2);
// add the filters.
this.$refs.myGrid.addfilter('firstname', filtergroup);
// apply the filters.
this.$refs.myGrid.applyfilters();
},
updatefilterconditions(e: Event): any {
let stringcomparisonoperators = ['CONTAINS', 'DOES_NOT_CONTAIN'];
let numericcomparisonoperators = ['LESS_THAN', 'GREATER_THAN'];
let datecomparisonoperators = ['LESS_THAN', 'GREATER_THAN'];
let booleancomparisonoperators = ['EQUAL', 'NOT_EQUAL'];
switch (type) {
case 'stringfilter':
return stringcomparisonoperators;
case 'numericfilter':
return numericcomparisonoperators;
case 'datefilter':
return datecomparisonoperators;
case 'booleanfilter':
return booleancomparisonoperators;
}
},
updatefilterpanel: function (filtertypedropdown1, filtertypedropdown2, filteroperatordropdown, filterinputfield1,
filterinputfield2, filterbutton, clearbutton, columnfilter, filtertype, filterconditions) {
let index1 = 0;
let index2 = 0;
if (columnfilter != null) {
let filter1 = columnfilter.getfilterat(0);
let filter2 = columnfilter.getfilterat(1);
if (filter1) {
index1 = filterconditions.indexOf(filter1.comparisonoperator);
let value1 = filter1.filtervalue;
filterinputfield1.val(value1);
}
if (filter2) {
index2 = filterconditions.indexOf(filter2.comparisonoperator);
let value2 = filter2.filtervalue;
filterinputfield2.val(value2);
}
}
filtertypedropdown1.jqxDropDownList({ autoDropDownHeight: true, selectedIndex: index1 });
filtertypedropdown2.jqxDropDownList({ autoDropDownHeight: true, selectedIndex: index2 });
},
ready(e: Event): any {
this.addfilter();
let localizationObject = {
filterstringcomparisonoperators: ['contains', 'does not contain'],
// filter numeric comparison operators.
filternumericcomparisonoperators: ['less than', 'greater than'],
// filter date comparison operators.
filterdatecomparisonoperators: ['less than', 'greater than'],
// filter bool comparison operators.
filterbooleancomparisonoperators: ['equal', 'not equal']
}
this.$refs.myGrid.localizestrings(localizationObject);
}
}
theme string ''
import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[theme]='"material"'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
toolbarheight number 34

Sets or gets the toolbar's height.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[showtoolbar]='true' [toolbarheight]='40'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
autoheight boolean false

Sets or gets the height of the grid to be equal to the summary height of the grid rows. This option should be set when the Grid is in paging mode.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
autorowheight boolean false

This property works along with the "autoheight" property. When it is set to true, the height of the Grid rows is dynamically changed depending on the cell values.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[autorowheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
columnsheight number 32

Sets or gets the columns height.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[columnsheight]='40'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
deferreddatafields Array<string> []

Determines the cell values displayed in a tooltip next to the scrollbar when the "scrollmode" is set to "deferred".

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='false'
[height]='100' [scrollmode]='"deferred"' [deferreddatafields]='["ContactName"]'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
groupsheaderheight number 34

Sets or gets the height of the Grid Groups Header.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[groupable]='true' [groupsheaderheight]='60'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
groupindentwidth number 20

Sets or gets the group indent size. This size is used when the grid is grouped. This is the size of the columns with expand/collapse toggle buttons.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[groupable]='true' [groupindentwidth]='40'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
height number | string 400

Sets or gets the Grid's height.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='false'
[height]='500'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
pagerheight number | string 40

Sets or gets the height of the Grid Pager.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[pageable]='true' [pagerheight]='50'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
rowsheight number 32

Sets or gets the height of the grid rows.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[rowsheight]='30'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
scrollbarsize number | string 15

Sets or gets the scrollbars size.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='false'
[height]='100' [scrollbarsize]='20'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
scrollmode GridScrollMode "default"
GridScrollMode: "default" | "logical" | "deferred"

Determines the scrolling mode.

Possible Values:
'default'
'logical'- the movement of the scrollbar thumb is by row, not by pixel
'deferred'-content is stationary when the user drags the Thumb of a ScrollBar
import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='false'
[height]='100' [scrollmode]='"logical"'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
scrollfeedback (row: GridScrollfeedback['row']) => string null
Interface GridScrollfeedback {
  row?: object;
}

When the "scrollmode" is set to "deferred", the "scrollfeedback" function may be used to display custom UI Tooltip next to the scrollbar.
import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='false'
[height]='100' [scrollmode]='"deferred"' [scrollfeedback]='scrollfeedback'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public scrollfeedback(row?: object): string {
return 'row ' + row.uid;
}
}
width string | number 600

Sets or gets the Grid's width.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
autosavestate boolean false

Determines whether the Grid automatically saves its current state.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[autoloadstate]='true' [autosavestate]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
autoloadstate boolean false

Determines whether the Grid automatically loads its current state(if there's already saved one). The Grid's state is loaded when the page is refreshed.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[autoloadstate]='true' [autosavestate]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
columns GridColumn[] []
GridAlign: "left" | "center" | "right"

GridFilterType: "textbox" | "input" | "checkedlist" | "list" | "number" | "bool" | "date" | "range" | "custom"

GridFilterCondition: "EMPTY" | "NOT_EMPTY" | "CONTAINS" | "CONTAINS_CASE_SENSITIVE" | "DOES_NOT_CONTAIN" | "DOES_NOT_CONTAIN_CASE_SENSITIVE" | "STARTS_WITH" | "STARTS_WITH_CASE_SENSITIVE" | "ENDS_WITH" | "ENDS_WITH_CASE_SENSITIVE" | "EQUAL" | "EQUAL_CASE_SENSITIVE" | "NULL" | "NOT_NULL""EQUAL" | "NOT_EQUAL" | "LESS_THAN" | "LESS_THAN_OR_EQUAL" | "GREATER_THAN" | "GREATER_THAN_OR_EQUAL" | "NULL" | "NOT_NULL"

GridColumnType: "number" | "checkbox" | "button" | "numberinput" | "dropdownlist" | "combobox" | "datetimeinput" | "textbox" | "rating" | "progressbar" | "template" | "custom"

Interface GridColumn {
  text?: string;
  datafield?: string;
  displayfield?: string;
  threestatecheckbox?: boolean;
  sortable?: boolean;
  filterable?: boolean;
  filter?: (cellValue?: any, rowData?: any, dataField?: string, filterGroup?: any, defaultFilterResult?: any) => any;
  buttonclick?: (row: number) => void;
  hideable?: boolean;
  hidden?: boolean;
  groupable?: boolean;
  menu?: boolean;
  exportable?: boolean;
  columngroup?: string;
  enabletooltips?: boolean;
  columntype?: GridColumnType;
  renderer?: (defaultText?: string, alignment?: string, height?: number) => string;
  rendered?: (columnHeaderElement?: any) => void;
  cellsrenderer?: (row?: number, columnfield?: string, value?: any, defaulthtml?: string, columnproperties?: any, rowdata?: any) => string;
  aggregatesrenderer?: (aggregates?: any, column?: any, element?: any, summaryData?: any) => string;
  validation?: (cell?: any, value?: number) => any;
  createwidget?: (row: any, column: any, value: string, cellElement: any) => void;
  initwidget?: (row: number, column: string, value: string, cellElement: any) => void;
  createfilterwidget?: (column: any, htmlElement: HTMLElement, editor: any) => void;
  createfilterpanel?: (datafield: string, filterPanel: any) => void;
  initeditor?: (row: number, cellvalue: any, editor: any, celltext: any, pressedChar: string, callback: any) => void;
  createeditor?: (row: number, cellvalue: any, editor: any, celltext: any, cellwidth: any, cellheight: any) => void;
  destroyeditor?: (row: number, callback: any) => void;
  geteditorvalue?: (row: number, cellvalue:any, editor:any) => any;
  cellbeginedit?: (row: number, datafield: string, columntype: string, value: any) => boolean;
  cellendedit?: (row: number, datafield: string, columntype: string, oldvalue: any, newvalue: any) => boolean;
  cellvaluechanging?: (row: number, datafield: string, columntype: string, oldvalue: any, newvalue: any) => string | void;
  createeverpresentrowwidget?: (datafield: string, htmlElement: HTMLElement, popup: any, addRowCallback: any) => any;
  initeverpresentrowwidget?: (datafield: string, htmlElement: HTMLElement, popup: any) => void;
  reseteverpresentrowwidgetvalue?: (datafield: string, htmlElement: HTMLElement) => void;
  geteverpresentrowwidgetvalue?: (datafield: string, htmlElement: HTMLElement) => any;
  destroyeverpresentrowwidget?: (htmlElement: HTMLElement) => void;
  validateeverpresentrowwidgetvalue?: (datafield: string, value: any, rowValues: any) => boolean | object;
  cellsformat?: string;
  cellclassname?: any;
  aggregates?: any;
  align?: GridAlign;
  cellsalign?: GridAlign;
  width?: number | string;
  minwidth?: any;
  maxwidth?: any;
  resizable?: boolean;
  draggable?: boolean;
  editable?: boolean;
  classname?: string;
  pinned?: boolean;
  nullable?: boolean;
  filteritems?: any;
  filterdelay?: number;
  filtertype?: GridFilterType;
  filtercondition?: GridFilterCondition;
}

Sets the Grid columns.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
enableSanitize boolean false

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
cardview boolean false

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
cardviewcolumns any []

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
cardheight number 250

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
cardsize number 3

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
columngroups Array<any> []
  • parentgroup - sets the column header's parent group name.
  • name - sets the column header's name.
  • align - sets the column header's alignment to 'left', 'center' or 'right'.
import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]="850" [source]="source" [columns]="columns" [autoheight]="true" [columngroups]="columngroups" >
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName', columngroup: 'ContactInfo' },
{ text: 'Contact Title', datafield: 'Title', columngroup: 'ContactInfo' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public columngroups = [{ text: 'Contact Info', name: 'ContactInfo', align: 'center' }];
}
columnsmenu boolean true

Enables or disables the columns dropdown menu.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[sortable]='true' [columnsmenu]='false'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
columnsresize boolean false

Enables or disables the columns resizing.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[columnsresize]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
columnsautoresize boolean true

Enables or disables the columns resizing when the column's border is double-clicked and columnsresize is set to true.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[columnsresize]='true' [columnsautoresize]='false'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
columnsreorder boolean false

Enables or disables the columns reordering.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[columnsreorder]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
charting GridCharting null
Interface GridCharting {
  appendTo?: string;
  colorScheme?: string;
  dialog?: (width: number, height: number, header: string, position: any, enabled: boolean) => void;
  formatSettings?: any;
  ready?: any;
}

Data visualization of Grid Data in a Chart.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
disabled boolean false

Enables or disables the Grid's plugin.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[disabled]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
editable boolean false

The editable property enables or disables the Grid editing feature.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[editable]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
batcheditable boolean false

The batcheditable property enables or disables the Grid batch editing feature. It works in combination with the editable property.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[editable]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
editmode GridEditMode 'selectedcell'
GridEditMode: "click" | "selectedcell" | "selectedrow" | "dblclick" | "programmatic"

The editmode property specifies the action that the end-user should make to open an editor.

Possible Values:
'click' - Marks the clicked cell as selected and shows the editor. The editor’s value is equal to the cell’s value
'selectedcell' - Marks the cell as selected. A second click on the selected cell shows the editor. The editor’s value is equal to the cell’s value
'selectedrow' - A second click on a selected row shows the row editors.
'dblclick' - Marks the clicked cell as selected and shows the editor. The editor’s value is equal to the cell’s value
'programmatic' - Cell editors are activated and deactivated only through the API(see begincelledit and endcelledit methods)
import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[editable]='true' [editmode]='"dblclick"'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
filter (cellValue?: GridFilter['cellValue'], rowData?: GridFilter['rowData'], dataField?: GridFilter['dataField'], filterGroup?: GridFilter['filterGroup'], defaultFilterResult?: GridFilter['defaultFilterResult']) => any null
Interface GridFilter {
  cellValue?: any;
  rowData?: any;
  dataField?: string;
  filterGroup?: any;
  defaultFilterResult?: boolean;
}

Custom Filtering function. It overrides the built-in Filtering. When the user filters, the Grid calls this function, when it is implemented. The function is expected to return a boolean value or undefined.

  • cellValue - current cell's value.
  • rowData - JSON object which contains the current row's data.
  • dataField - filter column's field.
  • filterGroup - group of filters.
  • defaultFilterResult - the default filter result.
import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[filterable]='true' [filter]='filter'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public filter(cellValue?: any, rowData?: any, dataField?: string, filterGroup?: any, defaultFilterResult?: boolean): any {
// implements a custom filter for the "Contactname" field.
if (dataField === "ContactName") {
var filters = filterGroup.getfilters();
for (var i = 0; i < filters.length; i++) {
var filter = filters[i];
var filterValue = filter.value;
var filterCondition = filter.condition;
var filterType = filter.type;
if (cellValue.indexOf("Ana") >= 0) {
return true;
}
}
return false;
}
}
}
filterable boolean false

Enables or disables the Grid Filtering feature. When the value of this property is true, the Grid displays a filtering panel in the columns popup menus.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[filterable]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
groupable boolean false

This property enables or disables the grouping feature.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[groupable]='true' [groups]='["ContactName"]'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
groups Array<string> []

Sets or gets the Grid groups when the Grouping feature is enabled.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[groupable]='true' [groups]='["ContactName"]'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
horizontalscrollbarstep number 5

Sets or gets the scrollbar's step when the user clicks the scroll arrows.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]="400" [source]="source" [columns]="columns" [autoheight]="true" [horizontalscrollbarstep]="200" >
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName', width: '100' },
{ text: 'Contact Title', datafield: 'Title', width: '100' },
{ text: 'City', datafield: 'City', width: '100' },
{ text: 'Country', datafield: 'Country', width: '100' },
{ text: 'Column5', width: '100' },
{ text: 'Column6', width: '100' },
{ text: 'Column7', width: '100' },
{ text: 'Column8', width: '100' },
{ text: 'Column9', width: '100' },
{ text: 'Column10', width: '100' };
public ];
}
horizontalscrollbarlargestep number 50

Sets or gets the scrollbar's large step. This property specifies the step with which the horizontal scrollbar's value is changed when the user clicks the area above or below the thumb.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]="400" [source]="source" [columns]="columns" [autoheight]="true" [horizontalscrollbarlargestep]="600" >
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName', width: '100' },
{ text: 'Contact Title', datafield: 'Title', width: '100' },
{ text: 'City', datafield: 'City', width: '100' },
{ text: 'Country', datafield: 'Country', width: '100' },
{ text: 'Column5', width: '100' },
{ text: 'Column6', width: '100' },
{ text: 'Column7', width: '100' },
{ text: 'Column8', width: '100' },
{ text: 'Column9', width: '100' },
{ text: 'Column10', width: '100' };
public ];
}
initrowdetails (index?: number, parentElement?: any, gridElement?: any, datarecord?: any) => void null

This function is called when the user expands the row details and the details are going to be rendered.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]="850" [source]="source" [columns]="columns" [autoheight]="true"
[rowdetails]="true" [initrowdetails]="initrowdetails" [rowdetailstemplate]="rowdetailstemplate" >
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public rowdetailstemplate = {
rowdetails: "<div style='margin: 10px;'>Row Details</div>",
rowdetailsheight: 50
};
initrowdetails(e: Event): any {
parentElement.children[0].innerHTML = 'Details: ' + index;
}
}
keyboardnavigation boolean true

Enables or disables the keyboard navigation.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[keyboardnavigation]='false'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
localization GridLocalizationobject null
Interface GridDateNaming {
  names?: Array<string>;
  namesAbbr?: Array<string>;
  namesShort?: Array<string>;
}

Interface GridLocalizationobject {
  filterstringcomparisonoperators?: any;
  filternumericcomparisonoperators?: any;
  filterdatecomparisonoperators?: any;
  filterbooleancomparisonoperators?: any;
  pagergotopagestring?: string;
  pagershowrowsstring?: string;
  pagerrangestring?: string;
  pagernextbuttonstring?: string;
  pagerpreviousbuttonstring?: string;
  sortascendingstring?: string;
  sortdescendingstring?: string;
  sortremovestring?: string;
  firstDay?: number;
  percentsymbol?: string;
  currencysymbol?: string;
  currencysymbolposition?: string;
  decimalseparator?: string;
  thousandsseparator?: string;
  days?: GridDateNaming;
  months?: GridDateNaming;
  addrowstring?: string;
  updaterowstring?: string;
  deleterowstring?: string;
  resetrowstring?: string;
  everpresentrowplaceholder?: string;
  emptydatastring?: string;
}

Localizes the Grid.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[pageable]='true' [localization]='localization'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public localization = getLocalization('de');
}
pagesize number 10

Sets or gets the number of visible rows per page when the Grid paging is enabled.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[pageable]='true' [pagesize]='2'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
pagesizeoptions Array<number | string> ['5', '10', '20']

Sets or gets the available page size options.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[pageable]='true' [pagesizeoptions]='["15", "30", "50"]'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
pagermode 'simple' | 'default' | 'material' "default"

Sets or gets the rendering mode of the pager. Available values - "simple" and "default" and "material".

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[pageable]='true' [pagermode]='"simple"'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
pagerbuttonscount number 5

Sets or gets the buttons displayed in the pager when the "pagermode" is set to "simple".

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]="850" [source]="source" [columns]="columns" [autoheight]="true" [pageable]="true"
[pagermode]="'simple'" [pagesize]="1" [pagerbuttonscount]="10" >
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico'],
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico'],
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico'],
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico'],
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
pageable boolean false

Enables or disables the Grid Paging feature. When the value of this property is true, the Grid displays a pager below the rows.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[pageable]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
autofill boolean false

Enables or disables the Grid Auto Fill feature. This feature can be used with 'multiplecellsadvanced' cell selection mode. It allows you to dynamically copy cell values.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[pageable]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
rowdetails boolean false

Enables or disables the row details. When this option is enabled, the Grid can show additional information below each grid row.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]="850" [source]="source" [columns]="columns" [autoheight]="true"
[rowdetails]="true" [initrowdetails]="initrowdetails" [rowdetailstemplate]="rowdetailstemplate" >
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public rowdetailstemplate = {
rowdetails: "<div style='margin: 10px;'>Row Details</div>",
rowdetailsheight: 50
};
initrowdetails(e: Event): any {
parentElement.children[0].innerHTML = 'Details: ' + index;
}
}
rowdetailstemplate any null

Determines the template of the row details. The rowdetails field specifies the HTML used for details. The rowdetailsheight specifies the height of the details.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]="850" [source]="source" [columns]="columns" [autoheight]="true"
[rowdetails]="true" [initrowdetails]="initrowdetails" [rowdetailstemplate]="rowdetailstemplate" >
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public rowdetailstemplate = {
rowdetails: "<div style='margin: 10px;'>Row Details</div>",
rowdetailsheight: 50
};
initrowdetails(e: Event): any {
parentElement.children[0].innerHTML = 'Details: ' + index;
}
}
ready () => void null

This function is called when the grid is initialized and the binding is complete.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[ready]='ready'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ready(): void {
alert('ready!')
}
}
rendered (type: any) => void null

Callback function which is called when the jqxGrid's render function is called either internally or not.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[rendered]='rendered'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public rendered(): void {
alert('rendered!')
}
}
renderstatusbar (statusbar?: GridRenderstatusbar['statusbar']) => void null
Interface GridRenderstatusbar {
  statusbar?: any;
}

Callback function which allows you to customize the rendering of the Grid's statusbar.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[showstatusbar]='true' [renderstatusbar]='renderstatusbar'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public renderstatusbar(statusbar?: any): void {
statusbar.append($("<span style='margin: 5px;'>Status Bar</span>"));
}
}
rendertoolbar (toolbar?: GridRendertoolbar['toolbar']) => void null
Interface GridRendertoolbar {
  toolbar?: any;
}

Callback function which allows you to customize the rendering of the Grid's toolbar.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[showtoolbar]='true' [rendertoolbar]='rendertoolbar'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public rendertoolbar(toolbar?: any): void {
toolbar.append($("<span style='margin: 5px;'>Tool Bar</span>"));
}
}
rendergridrows (params?: any) => any null

This is a function called when the grid is used in virtual mode. The function should return an array of rows which will be rendered by the Grid.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
[<div style]="font-size 13px; font-family Verdana; float left">
`<jqxGrid [width]="800" [source]="dataAdapter" [columns]="columns"
[autoheight]="true" [virtualmode]="true" [pageable]="true"
[rendergridrows]="renderGridRows">
</JqxGrid>
</div>,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
datatype: 'array',
localdata: {},
totalrecords: 1000000
}
public firstNames = [
'Andrew', 'Nancy', 'Shelley', 'Regina', 'Yoshi', 'Antoni', 'Mayumi', 'Ian', 'Peter', 'Lars', 'Petra', 'Martin', 'Sven', 'Elio', 'Beate', 'Cheryl', 'Michael', 'Guylene'
];
public lastNames = [
'Fuller', 'Davolio', 'Burke', 'Murphy', 'Nagase', 'Saavedra', 'Ohno', 'Devling', 'Wilson', 'Peterson', 'Winkler', 'Bein', 'Petersen', 'Rossi', 'Vileid', 'Saylor', 'Bjorn', 'Nodier'
];
public productNames = [
'Black Tea', 'Green Tea', 'Caffe Espresso', 'Doubleshot Espresso', 'Caffe Latte', 'White Chocolate Mocha', 'Cramel Latte', 'Caffe Americano', 'Cappuccino', 'Espresso Truffle', 'Espresso con Panna', 'Peppermint Mocha Twist'
];
public priceValues = [
'2.25', '1.5', '3.0', '3.3', '4.5', '3.6', '3.8', '2.5', '5.0', '1.75', '3.25', '4.0'
];
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Id', datafield: 'id', width: 50 },
{ text: 'First Name', datafield: 'firstname', width: 120 },
{ text: 'Last Name', datafield: 'lastname', width: 120 },
{ text: 'Product', datafield: 'productname', width: 180 },
{ text: 'Quantity', datafield: 'quantity', width: 100, cellsalign: 'right' },
{ text: 'Unit Price', datafield: 'price', width: 100, cellsalign: 'right', cellsformat: 'c2' },
{ text: 'Total', datafield: 'total', cellsrenderer: this.totalcolumnrenderer, cellsalign: 'right' }
];
generateData(e: Event): any {
let data = {};
for (let i = startindex; i < endindex; i++) {
let row = {};
let productindex = Math.floor(Math.random() * this.productNames.length);
let price = parseFloat(this.priceValues[productindex]);
let quantity = 1 + Math.round(Math.random() * 10);
row['id'] = i;
row['firstname'] = this.firstNames[Math.floor(Math.random() * this.firstNames.length)];
row['lastname'] = this.lastNames[Math.floor(Math.random() * this.lastNames.length)];
row['productname'] = this.productNames[productindex];
row['price'] = price;
row['quantity'] = quantity;
row['total'] = price * quantity;
data[i] = row;
}
return data;
},
renderGridRows(e: Event): any {
let data = this.generateData(params.startindex, params.endindex);
return data;
},
totalcolumnrenderer(e: Event): any {
let newCellValue = jqx.dataFormat.formatnumber(cellvalue, 'c2');
return '<span style="margin: 6px 3px; font-size: 12px; float: right; font-weight: bold;">' + newCellValue + '</span>';
}
}
sortable boolean false

The sortable property enables or disables the sorting feature.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[sortable]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
sortmode string 'one'

The sortmode property determines the Grid can sort by single or multiple columns.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[sortable]='true' [sortmode]='"many"'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
sortmodekey string ''

The sortmodekey property determines the Grid can sort by multiple columns only when the property is set to Control and the control key is pressed.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[sortable]='true' [sortmode]='"many"' [sortmodekey]='"Control"'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
selectedrowindex number -1

Selects a row at a specified index.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[selectedrowindex]='2'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
selectedrowindexes Array<number> []

Selects single or multiple rows.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[selectionmode]='"multiplerows"' [selectedrowindexes]='[0, 2]'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
source GridSource {}
GridDataType: "xml" | "json" | "jsonp" | "tsv" | "csv" | "local" | "array" | "observablearray"

GridType: "GET" | "POST"

GridSortDirection: "asc" | "desc"

Interface GridSourceDataFields {
  name?: string;
  type?: GridSourceDataFieldsType;
  format?: string;
  map?: string;
  id?: string;
  text?: string;
  source?: Array<any>;
}

Interface GridSource {
  url?: string;
  data?: any;
  localdata?: any;
  datatype?: GridDataType;
  type?: GridType;
  id?: string;
  root?: string;
  record?: string;
  datafields?: Array<GridSourceDataFields>;
  pagenum?: number;
  pagesize?: number;
  pager?: num?: number, pagesize?: number, oldpagenum?: number) => any;
  sortcolumn?: string;
  sortdirection?: GridSortDirection;
  sort?: (column?: any, direction?: any) => void;
  filter?: (filters?: any, recordsArray?: any) => void;
  addrow?: (rowid?: any, rowdata?: any, position?: any, commit?: boolean) => void;
  deleterow?: (rowid?: any, commit?: boolean) => void;
  updaterow?: (rowid?: any, newdata?: any, commit? : any) => void;
  processdata?: (data: any) => void;
  formatdata?: (data: any) => any;
  async?: boolean;
  totalrecords?: number;
  unboundmode?: boolean;
}

Sets and gets the source.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
sorttogglestates GridSortToggleStates 2
GridSortToggleStates: "0" | "1" | "2"

Possible Values:
'0'-disables toggling
'1'-enables togging. Click on a column toggles the sort direction
'2'-enables remove sorting option
import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[sortable]='true' [sorttogglestates]='1'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
updatedelay number 0

Sets or gets the rendering update delay. This could be used for deferred scrolling scenarios.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'
[updatedelay]='20'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
}
virtualmode boolean false

Enables or disables the virtual data mode.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
[<div style]="font-size 13px; font-family Verdana; float left">
`<jqxGrid [width]="800" [source]="dataAdapter" [columns]="columns"
[autoheight]="true" [virtualmode]="true" [pageable]="true"
[rendergridrows]="renderGridRows">
</JqxGrid>
</div>,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
datatype: 'array',
localdata: {},
totalrecords: 1000000
}
public firstNames = [
'Andrew', 'Nancy', 'Shelley', 'Regina', 'Yoshi', 'Antoni', 'Mayumi', 'Ian', 'Peter', 'Lars', 'Petra', 'Martin', 'Sven', 'Elio', 'Beate', 'Cheryl', 'Michael', 'Guylene'
];
public lastNames = [
'Fuller', 'Davolio', 'Burke', 'Murphy', 'Nagase', 'Saavedra', 'Ohno', 'Devling', 'Wilson', 'Peterson', 'Winkler', 'Bein', 'Petersen', 'Rossi', 'Vileid', 'Saylor', 'Bjorn', 'Nodier'
];
public productNames = [
'Black Tea', 'Green Tea', 'Caffe Espresso', 'Doubleshot Espresso', 'Caffe Latte', 'White Chocolate Mocha', 'Cramel Latte', 'Caffe Americano', 'Cappuccino', 'Espresso Truffle', 'Espresso con Panna', 'Peppermint Mocha Twist'
];
public priceValues = [
'2.25', '1.5', '3.0', '3.3', '4.5', '3.6', '3.8', '2.5', '5.0', '1.75', '3.25', '4.0'
];
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Id', datafield: 'id', width: 50 },
{ text: 'First Name', datafield: 'firstname', width: 120 },
{ text: 'Last Name', datafield: 'lastname', width: 120 },
{ text: 'Product', datafield: 'productname', width: 180 },
{ text: 'Quantity', datafield: 'quantity', width: 100, cellsalign: 'right' },
{ text: 'Unit Price', datafield: 'price', width: 100, cellsalign: 'right', cellsformat: 'c2' },
{ text: 'Total', datafield: 'total', cellsrenderer: this.totalcolumnrenderer, cellsalign: 'right' }
];
generateData(e: Event): any {
let data = {};
for (let i = startindex; i < endindex; i++) {
let row = {};
let productindex = Math.floor(Math.random() * this.productNames.length);
let price = parseFloat(this.priceValues[productindex]);
let quantity = 1 + Math.round(Math.random() * 10);
row['id'] = i;
row['firstname'] = this.firstNames[Math.floor(Math.random() * this.firstNames.length)];
row['lastname'] = this.lastNames[Math.floor(Math.random() * this.lastNames.length)];
row['productname'] = this.productNames[productindex];
row['price'] = price;
row['quantity'] = quantity;
row['total'] = price * quantity;
data[i] = row;
}
return data;
},
renderGridRows(e: Event): any {
let data = this.generateData(params.startindex, params.endindex);
return data;
},
totalcolumnrenderer(e: Event): any {
let newCellValue = jqx.dataFormat.formatnumber(cellvalue, 'c2');
return '<span style="margin: 6px 3px; font-size: 12px; float: right; font-weight: bold;">' + newCellValue + '</span>';
}
}
verticalscrollbarstep number 5

Sets or gets the scrollbar's step when the user clicks the scroll arrows.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid [width]="getWidth" [source]="dataAdapter" [columns]="columns" [columnsresize]="true" [verticalscrollbarstep]="200">
</JqxGrid>,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public firstNames = [
'Andrew', 'Nancy', 'Shelley', 'Regina', 'Yoshi', 'Antoni', 'Mayumi', 'Ian', 'Peter', 'Lars', 'Petra', 'Martin', 'Sven', 'Elio', 'Beate', 'Cheryl', 'Michael', 'Guylene'
];
public lastNames = [
'Fuller', 'Davolio', 'Burke', 'Murphy', 'Nagase', 'Saavedra', 'Ohno', 'Devling', 'Wilson', 'Peterson', 'Winkler', 'Bein', 'Petersen', 'Rossi', 'Vileid', 'Saylor', 'Bjorn', 'Nodier'
];
public productNames = [
'Black Tea', 'Green Tea', 'Caffe Espresso', 'Doubleshot Espresso', 'Caffe Latte', 'White Chocolate Mocha', 'Cramel Latte', 'Caffe Americano', 'Cappuccino', 'Espresso Truffle', 'Espresso con Panna', 'Peppermint Mocha Twist'
];
public priceValues = [
'2.25', '1.5', '3.0', '3.3', '4.5', '3.6', '3.8', '2.5', '5.0', '1.75', '3.25', '4.0'
];
public source = {
localdata: public generateData(),
datatype: 'array',
datafields:
[
{ name: 'firstname', type: 'string' },
{ name: 'lastname', type: 'string' },
{ name: 'productname', type: 'string' },
{ name: 'quantity', type: 'number' },
{ name: 'price', type: 'number' },
{ name: 'total', type: 'number' }
]
};
public getWidth = getWidth('grid');
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Name', datafield: 'firstname', width: 120 },
{ text: 'Last Name', datafield: 'lastname', width: 120 },
{ text: 'Product', datafield: 'productname', width: 180 },
{ text: 'Quantity', datafield: 'quantity', width: 80, cellsalign: 'right' },
{ text: 'Unit Price', datafield: 'price', width: 90, cellsalign: 'right', cellsformat: 'c2' },
{ text: 'Total', datafield: 'total', cellsalign: 'right', cellsformat: 'c2' }
];
generateData(e: Event): any {
let data = {};
for (let i = 0; i < 200; i++) {
let row = {};
let productindex = Math.floor(Math.random() * this.productNames.length);
let price = parseFloat(this.priceValues[productindex]);
let quantity = 1 + Math.round(Math.random() * 10);
row['id'] = i;
row['firstname'] = this.firstNames[Math.floor(Math.random() * this.firstNames.length)];
row['lastname'] = this.lastNames[Math.floor(Math.random() * this.lastNames.length)];
row['productname'] = this.productNames[productindex];
row['price'] = price;
row['quantity'] = quantity;
row['total'] = price * quantity;
data[i] = row;
}
return data;
}
}
verticalscrollbarlargestep number 400

Sets or gets the scrollbar's large step. This property specifies the step with which the vertical scrollbar's value is changed when the user clicks the area above or below the thumb.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid [width]="getWidth" [source]="dataAdapter" [columns]="columns" [columnsresize]="true" [verticalscrollbarlargestep]="2000">
</JqxGrid>,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public firstNames = [
'Andrew', 'Nancy', 'Shelley', 'Regina', 'Yoshi', 'Antoni', 'Mayumi', 'Ian', 'Peter', 'Lars', 'Petra', 'Martin', 'Sven', 'Elio', 'Beate', 'Cheryl', 'Michael', 'Guylene'
];
public lastNames = [
'Fuller', 'Davolio', 'Burke', 'Murphy', 'Nagase', 'Saavedra', 'Ohno', 'Devling', 'Wilson', 'Peterson', 'Winkler', 'Bein', 'Petersen', 'Rossi', 'Vileid', 'Saylor', 'Bjorn', 'Nodier'
];
public productNames = [
'Black Tea', 'Green Tea', 'Caffe Espresso', 'Doubleshot Espresso', 'Caffe Latte', 'White Chocolate Mocha', 'Cramel Latte', 'Caffe Americano', 'Cappuccino', 'Espresso Truffle', 'Espresso con Panna', 'Peppermint Mocha Twist'
];
public priceValues = [
'2.25', '1.5', '3.0', '3.3', '4.5', '3.6', '3.8', '2.5', '5.0', '1.75', '3.25', '4.0'
];
public source = {
localdata: public generateData(),
datatype: 'array',
datafields:
[
{ name: 'firstname', type: 'string' },
{ name: 'lastname', type: 'string' },
{ name: 'productname', type: 'string' },
{ name: 'quantity', type: 'number' },
{ name: 'price', type: 'number' },
{ name: 'total', type: 'number' }
]
};
public getWidth = getWidth('grid');
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Name', datafield: 'firstname', width: 120 },
{ text: 'Last Name', datafield: 'lastname', width: 120 },
{ text: 'Product', datafield: 'productname', width: 180 },
{ text: 'Quantity', datafield: 'quantity', width: 80, cellsalign: 'right' },
{ text: 'Unit Price', datafield: 'price', width: 90, cellsalign: 'right', cellsformat: 'c2' },
{ text: 'Total', datafield: 'total', cellsalign: 'right', cellsformat: 'c2' }
];
generateData(e: Event): any {
let data = {};
for (let i = 0; i < 200; i++) {
let row = {};
let productindex = Math.floor(Math.random() * this.productNames.length);
let price = parseFloat(this.priceValues[productindex]);
let quantity = 1 + Math.round(Math.random() * 10);
row['id'] = i;
row['firstname'] = this.firstNames[Math.floor(Math.random() * this.firstNames.length)];
row['lastname'] = this.lastNames[Math.floor(Math.random() * this.lastNames.length)];
row['productname'] = this.productNames[productindex];
row['price'] = price;
row['quantity'] = quantity;
row['total'] = price * quantity;
data[i] = row;
}
return data;
}
}

Events

bindingcomplete Event

This event is triggered when the binding is completed. Note: Bind to that event before the Grid's initialization, because if you data bind the Grid to a local data source and bind to the "bindingcomplete" event after the initializaation, the data binding will be already completed.

Code examples

Bind to the bindingcomplete event of jqxGrid.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid (onBindingcomplete)="onBindingcomplete($event)"
[width]="850" [columns]="columns" [autoheight]="true" >
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
onBindingcomplete(e: Event): any {
alert('do something...');
}
}

columnresized Event

This event is triggered when a Grid Column is resized.

Code examples

Bind to the columnresized event of jqxGrid.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid (onColumnresized)="onColumnresized($event)"
[width]="850" [source]="source" [columns]="columns" [columnsresize]="true" [autoheight]="true" >
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
onColumnresized(e: Event): any {
alert('do something...');
}
}

columnreordered Event

This event is triggered when a Grid Column is moved to a new position.

Code examples

Bind to the columnreordered event of jqxGrid.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid (onColumnreordered)="onColumnreordered($event)"
[width]="850" [source]="source" [columns]="columns" [columnsreorder]="true" [autoheight]="true" >
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
onColumnreordered(e: Event): any {
alert('do something...');
}
}

columnclick Event

This event is triggered when a column is clicked.

Code examples

Bind to the columnclick event of jqxGrid.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid (onColumnclick)="onColumnclick($event)"
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public onColumnclick(e: Event): void {
alert('do something...');
}
}

cellclick Event

This event is triggered when a cell is clicked.

Code examples

Bind to the cellclick event of jqxGrid.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid (onCellclick)="onCellclick($event)"
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public onCellclick(e: Event): void {
alert('do something...');
}
}

celldoubleclick Event

This event is triggered when a cell is double-clicked.

Code examples

Bind to the celldoubleclick event of jqxGrid.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid (onCelldoubleclick)="onCelldoubleclick($event)"
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public onCelldoubleclick(e: Event): void {
alert('do something...');
}
}

cellselect Event

This event is triggered when a cell is selected.

Code examples

Bind to the cellselect event of jqxGrid.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid (onCellselect)="onCellselect($event)"
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.setOptions({ selectionmode: 'singlecell' });
}
public onCellselect(e: Event): void {
alert('do something...');
}
}

cellunselect Event

This event is triggered when a cell is unselected.

Code examples

Bind to the cellunselect event of jqxGrid.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid (onCellunselect)="onCellunselect($event)"
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.setOptions({ selectionmode: 'singlecell' });
}
public onCellunselect(e: Event): void {
alert('do something...');
}
}

cellvaluechanged Event

This event is triggered when a cell's value is changed.

Code examples

Bind to the cellvaluechanged event of jqxGrid.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid (onCellvaluechanged)="onCellvaluechanged($event)"
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.setOptions({ editable: true });
}
public onCellvaluechanged(e: Event): void {
alert('do something...');
}
}

cellbeginedit Event

This event is triggered when a cell's editor is displayed.

Code examples

Bind to the cellbeginedit event of jqxGrid.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid (onCellbeginedit)="onCellbeginedit($event)"
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.setOptions({ editable: true });
}
public onCellbeginedit(e: Event): void {
alert('do something...');
}
}

cellendedit Event

This event is triggered when a cell's edit operation has ended.

Code examples

Bind to the cellendedit event of jqxGrid.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid (onCellendedit)="onCellendedit($event)"
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.setOptions({ editable: true });
}
public onCellendedit(e: Event): void {
alert('do something...');
}
}

filter Event

This event is triggered when the Grid is filtered.

Code examples

Bind to the filter event of jqxGrid.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid (onFilter)="onFilter($event)"
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.setOptions({ filterable: true });
}
public onFilter(e: Event): void {
alert('do something...');
}
}

groupschanged Event

This event is triggered when a group is added, inserted or removed.

Code examples

Bind to the groupschanged event of jqxGrid.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid (onGroupschanged)="onGroupschanged($event)"
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.setOptions({ groupable: true });
}
public onGroupschanged(e: Event): void {
alert('do something...');
}
}

groupexpand Event

This event is triggered when a group is expanded.

Code examples

Bind to the groupexpand event of jqxGrid.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid (onGroupexpand)="onGroupexpand($event)"
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.setOptions({ groupable: true });
}
public onGroupexpand(e: Event): void {
alert('do something...');
}
}

groupcollapse Event

This event is triggered when a group is collapsed.

Code examples

Bind to the groupcollapse event of jqxGrid.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid (onGroupcollapse)="onGroupcollapse($event)"
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.setOptions({ groupable: true });
}
public onGroupcollapse(e: Event): void {
alert('do something...');
}
}

pagechanged Event

This event is triggered when the current page is changed.

Code examples

Bind to the pagechanged event of jqxGrid.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid (onPagechanged)="onPagechanged($event)"
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.setOptions({ pageable: true, pagesize: 1 });
}
public onPagechanged(e: Event): void {
alert('do something...');
}
}

pagesizechanged Event

This event is triggered when the page size is changed.

Code examples

Bind to the pagesizechanged event of jqxGrid.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid (onPagesizechanged)="onPagesizechanged($event)"
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.setOptions({ pageable: true });
}
public onPagesizechanged(e: Event): void {
alert('do something...');
}
}

rowclick Event

This event is triggered when a row is clicked.

Code examples

Bind to the rowclick event of jqxGrid.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid (onRowclick)="onRowclick($event)"
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public onRowclick(e: Event): void {
alert('do something...');
}
}

rowdoubleclick Event

This event is triggered when a row is double clicked.

Code examples

Bind to the rowdoubleclick event of jqxGrid.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid (onRowdoubleclick)="onRowdoubleclick($event)"
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public onRowdoubleclick(e: Event): void {
alert('do something...');
}
}

rowselect Event

This event is triggered when a row is selected.

Code examples

Bind to the rowselect event of jqxGrid.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid (onRowselect)="onRowselect($event)"
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public onRowselect(e: Event): void {
alert('do something...');
}
}

rowunselect Event

This event is triggered when a row is unselected.

Code examples

Bind to the rowunselect event of jqxGrid.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid (onRowunselect)="onRowunselect($event)"
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public onRowunselect(e: Event): void {
alert('do something...');
}
}

rowexpand Event

This event is triggered when a row with details is expanded.

Code examples

Bind to the rowexpand event of jqxGrid.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid @rowexpand="onRowexpand($event)" [width]="850" [source]="source" [columns]="columns"
[rowdetails]="true" [initrowdetails]="initrowdetails" [rowdetailstemplate]="rowdetailstemplate" [autoheight]="true" >
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public rowdetailstemplate = {
rowdetails: "<div style='margin: 10px;'>Row Details</div>",
rowdetailsheight: 50
};
initrowdetails(e: Event): any {
parentElement.children[0].innerHTML = 'Details: ' + index;
},
onRowexpand(e: Event): any {
alert('do something...');
}
}

rowcollapse Event

This event is triggered when a row with details is collapsed.

Code examples

Bind to the rowcollapse event of jqxGrid.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid @rowcollapse="onRowcollapse($event)" [width]="850" [source]="source" [columns]="columns"
[rowdetails]="true" [initrowdetails]="initrowdetails" [rowdetailstemplate]="rowdetailstemplate" [autoheight]="true" >
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public rowdetailstemplate = {
rowdetails: "<div style='margin: 10px;'>Row Details</div>",
rowdetailsheight: 50
};
initrowdetails(e: Event): any {
parentElement.children[0].innerHTML = 'Details: ' + index;
},
onRowcollapse(e: Event): any {
alert('do something...');
}
}

sort Event

This event is triggered when the Grid is sorted.

Code examples

Bind to the sort event of jqxGrid.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid (onSort)="onSort($event)"
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.setOptions({ sortable: true, showsortmenuitems: true });
}
public onSort(e: Event): void {
alert('do something...');
}
}

Methods

NameArgumentsReturn Type
autoresizecolumns type

Auto-resizes all columns.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
import { jqxButtonComponent } from 'jqwidgets-ng/jqxbutton';
@Component({
selector: 'app-root',
template:
<div>
`<jqxGrid #myGrid
[width]="410" [source]="source" [columns]="columns" [autoheight]="true" >
</jqxGrid>`
<JqxButton style="margin-top 20px;" width="150" (onClick)="resizeColumns()">Auto Resize Columns</JqxButton>
</div>,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName', width: 50 },
{ text: 'Contact Title', datafield: 'Title', width: 50 },
{ text: 'City', datafield: 'City', width: 50 },
{ text: 'Country', datafield: 'Country' }
];
resizeColumns(e: Event): any {
this.$refs.myGrid.autoresizecolumns();
}
}
autoresizecolumn dataField, type

Auto-resizes a column.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
import { jqxButtonComponent } from 'jqwidgets-ng/jqxbutton';
@Component({
selector: 'app-root',
template:
<div>
`<jqxGrid #myGrid
[width]="500" [source]="source" [columns]="columns" [autoheight]="true" >
</jqxGrid>`
<JqxButton style="margin-top 20px;" width="200" (onClick)="resizeColumn()">Auto Resize Second Column</JqxButton>
</div>,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName', width: 150 },
{ text: 'Contact Title', datafield: 'Title', width: 50 },
{ text: 'City', datafield: 'City', width: 100 },
{ text: 'Country', datafield: 'Country' }
];
resizeColumn(e: Event): any {
this.$refs.myGrid.autoresizecolumn('Title');
}
}
beginupdate None

Starts an update operation. This is appropriate when calling multiple methods or set multiple properties at once. Optional boolean parameter: suspendAllActions. When you call beginupdate with parameter equal to true, the jqxGrid stops all rendering processes and when you call "endupdate", it will call the "render" method. Otherwise, it will try to resume its state with minimial performance impact. Use the suspendAllActions when you make multiple changes which require full-rerender such as changing the Grid's source, columns, groups.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
import { jqxButtonComponent } from 'jqwidgets-ng/jqxbutton';
@Component({
selector: 'app-root',
template:
<div>
`<jqxGrid #myGrid
[width]="800" [source]="source" [columns]="columns" [sortable]="true" [autoheight]="true" >
</jqxGrid>`
<JqxButton style="margin-right 20px;" width="100" (onClick)="beginUpdate()">Begin Update</JqxButton>
<JqxButton width="100" (onClick)="endUpdate()">End Update</JqxButton>
</div>,
styles: [`
>
.jqx-button {
display: inline-block;
margin-top: 20px;
}
`]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
beginUpdate(e: Event): any {
this.$refs.myGrid.beginupdate();
},
endUpdate(e: Event): any {
this.$refs.myGrid.endupdate();
}
}
clear None

Clears the Grid contents.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.clear();
}
}
createChart type, dataSource

Creates a Chart from the Grid data.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.createChart();
}
}
destroy None

Removes the Grid from the document and releases its resources.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.destroy();
}
}
endupdate None

Ends the update operation.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
import { jqxButtonComponent } from 'jqwidgets-ng/jqxbutton';
@Component({
selector: 'app-root',
template:
<div>
`<jqxGrid #myGrid
[width]="800" [source]="source" [columns]="columns" [sortable]="true" [autoheight]="true" >
</jqxGrid>`
<JqxButton style="margin-right 20px;" width="100" (onClick)="beginUpdate()">Begin Update</JqxButton>
<JqxButton width="100" (onClick)="endUpdate()">End Update</JqxButton>
</div>,
styles: [`
>
.jqx-button {
display: inline-block;
margin-top: 20px;
}
`]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
beginUpdate(e: Event): any {
this.$refs.myGrid.beginupdate();
},
endUpdate(e: Event): any {
this.$refs.myGrid.endupdate();
}
}
ensurerowvisible rowBoundIndex

Scrolls to a row. The parameter is a bound index.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]="850" [source]="source" [columns]="columns" [height]="70" >
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.ensurerowvisible(2);
}
}
focus None

Sets the keyboard Focus to the jqxGrid widget.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.focus();
}
}
getcolumnindex dataField

Gets the index of a column in the columns collection.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.getcolumnindex('Title');
}
}
getcolumn dataField

Gets a column by datafield value.Column's fields:

  • datafield - column's datafield. To get the cells labels and values from the data source, the Grid uses the "datafield" and "displayfield" properties. If the "displayfield" is not set, the "displayfield" is equal to the "datafield'.
  • text - column's text.
  • displayfield - column's displayfield. To get the cells labels and values from the data source, the Grid uses the "datafield" and "displayfield" properties. If the "displayfield" is not set, the "displayfield" is equal to the "datafield'.
  • sortable - determines whether the column is sortable.
  • filterable - determines whether the column is filterable.
  • exportable - determines whether the column will be exported through the "exportdata" method.
  • editable - determines whether the column is editable.
  • groupable - determines whether the column is groupable.
  • resizable - determines whether the column is resizable.
  • draggable - determines whether the column is draggable.
  • classname - determines the column's header classname.
  • cellclassname - determines the column's cells classname.
  • width - determines the column's width.
  • menu - determines whether the column has an associated popup menu or not.
import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.getcolumn('Title');
}
}
getcolumnproperty dataField, propertyName

Gets a property of a column. Possible property names: 'text', 'hidden', 'hideable', 'renderer', 'cellsrenderer', 'align', 'cellsalign', 'cellsformat', 'pinned', 'contenttype', 'resizable', 'filterable', 'editable', 'cellclassname', 'classname', 'width', 'minwidth', 'maxwidth'

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.getcolumnproperty('Title','text');
}
}
getrowid rowBoundIndex

Gets the id of a row. The returned value is a 'string' or 'number' depending on the id's type. The parameter is the row's bound index.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.getrowid(0);
}
}
getrowdata rowBoundIndex

Gets the data of a row. The returned value is a JSON object. The parameter is the row's bound index. Note: If you pass a bound index of a row which is not visible in the Grid, the method returns null.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.getrowdata(0);
}
}
getrowdatabyid rowID

Gets the data of a row. The returned value is a JSON object. The parameter is the row's id.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.getrowdatabyid(0);
}
}
getrowboundindexbyid rowID

Gets the index of a row in the array returned by the getboundrows method.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.getrowboundindexbyid(0);
}
}
getrowboundindex rowDisplayIndex

Gets the index of a row in the array returned by the getboundrows method.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.getrowboundindex(0);
}
}
getrows None

Gets all rows. Returns an array of all rows loaded in the Grid. If the Grid is filtered, the returned value is an array of the filtered records.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.getrows();
}
}
getboundrows None

Gets all rows loaded from the data source. The method returns an Array of all rows. The Grid's sorting, filtering, grouping and paging will not affect the result of this method. It will always return the rows collection loaded from the data source.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.getboundrows();
}
}
getdisplayrows None

Gets all rows that are currently displayed in the Grid. The method returns an Array of the displayed rows. The Grid's sorting, filtering, grouping and paging will affect the result of this method.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.getdisplayrows();
}
}
getdatainformation None

Gets bound data information.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.setOptions({ pageable: true, sortable: true });
this.myGrid.getdatainformation();
}
}
getsortinformation None

Gets the sort information.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.setOptions({ sortable: true });
this.myGrid.getsortinformation();
}
}
getpaginginformation None

Gets the paging information.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.setOptions({ pageable: true });
this.myGrid.getpaginginformation();
}
}
hidecolumn dataField

Hides a column.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
import { jqxButtonComponent } from 'jqwidgets-ng/jqxbutton';
@Component({
selector: 'app-root',
template:
<div>
`<jqxGrid #myGrid
[width]="800" [source]="source" [columns]="columns" [autoheight]="true" >
</jqxGrid>`
<JqxButton style="margin-right 20px;" width="100" (onClick)="showColumn()">Show Column</JqxButton>
<JqxButton width="100" (onClick)="hideColumn()">Hide Column</JqxButton>
</div>,
styles: [`
>
.jqx-button {
display: inline-block;
margin-top: 20px;
}
`]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName'},
{ text: 'Contact Title', datafield: 'Title'},
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
showColumn(e: Event): any {
this.$refs.myGrid.showcolumn('ContactName');
},
hideColumn(e: Event): any {
this.$refs.myGrid.hidecolumn('ContactName');
}
}
hideloadelement None

Hides the data loading image.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
import { jqxButtonComponent } from 'jqwidgets-ng/jqxbutton';
@Component({
selector: 'app-root',
template:
<div>
`<jqxGrid #myGrid
[width]="800" [source]="source" [columns]="columns" [autoheight]="true" >
</jqxGrid>`
<JqxButton style="margin-right 20px;" width="150" (onClick)="showElement()">Show Load Element</JqxButton>
<JqxButton width="150" (onClick)="hideElement()">Hide Load Element</JqxButton>
</div>,
styles: [`
>
.jqx-button {
display: inline-block;
margin-top: 20px;
}
`]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
showElement(e: Event): any {
this.$refs.myGrid.showloadelement();
},
hideElement(e: Event): any {
this.$refs.myGrid.hideloadelement();
}
}
hiderowdetails rowBoundIndex

Hides the details of a row.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
import { jqxButtonComponent } from 'jqwidgets-ng/jqxbutton';
@Component({
selector: 'app-root',
template:
<div>
`<jqxGrid #myGrid
[width]="800" [source]="source" [columns]="columns" [autoheight]="true"
[rowdetails]="true" [initrowdetails]="initrowdetails" [rowdetailstemplate]="rowdetailstemplate" >
</jqxGrid>`
<JqxButton style="margin-right 20px;" width="150" (onClick)="showDetails()">Show Row Details</JqxButton>
<JqxButton width="150" (onClick)="hideDetails()">Hide Row Details</JqxButton>
</div>,
styles: [`
>
.jqx-button {
display: inline-block;
margin-top: 20px;
}
`]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public rowdetailstemplate = {
rowdetails: "<div style='margin: 10px;'>Row Details</div>",
rowdetailsheight: 50
};
initrowdetails(e: Event): any {
parentElement.children[0].innerHTML = 'Details: ' + index;
},
showDetails(e: Event): any {
this.$refs.myGrid.showrowdetails(0);
},
hideDetails(e: Event): any {
this.$refs.myGrid.hiderowdetails(0);
}
}
iscolumnvisible dataField

Gets whether a column is visible. Returns a boolean value.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.iscolumnvisible('ContactName');
}
}
iscolumnpinned dataField

Gets whether a column is pinned. Returns a boolean value.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.iscolumnpinned('ContactName');
}
}
localizestrings localizationobject

Localizes the grid strings. This method allows you to change the valus of all Grid strings and also to change the cells formatting settings.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.setOptions({ pageable: true });
this.myGrid.localizestrings(getLocalization('de'));
}
}
pincolumn dataField

Pins the column.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
import { jqxButtonComponent } from 'jqwidgets-ng/jqxbutton';
@Component({
selector: 'app-root',
template:
<div>
`<jqxGrid #myGrid
[width]="800" [source]="source" [columns]="columns" [autoheight]="true" >
</jqxGrid>`
<JqxButton style="margin-right 20px;" width="100" (onClick)="pinColumn()">Pin Column</JqxButton>
<JqxButton width="100" (onClick)="unpinColumn()">Unpin Column</JqxButton>
</div>,
styles: [`
>
.jqx-button {
display: inline-block;
margin-top: 20px;
}
`]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
pinColumn(e: Event): any {
this.$refs.myGrid.pincolumn('ContactName');
},
unpinColumn(e: Event): any {
this.$refs.myGrid.unpincolumn('ContactName');
}
}
refreshdata None

Refreshes the data.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.refreshdata();
}
}
refresh None

Repaints the Grid View.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.refresh();
}
}
render None

Renders the Grid contents. This method completely refreshes the Grid cells, columns, layout and repaints the view.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.render();
}
}
scrolloffset top, left

Scrolls the grid contents.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]="400" [source]="source" [columns]="columns" [autoheight]="true" >
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName', width: 150 },
{ text: 'Contact Title', datafield: 'Title', width: 150 },
{ text: 'City', datafield: 'City', width: 150 },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.scrolloffset(0, 100);
}
}
scrollposition None

Returns the scrollbars position.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]="400" [source]="source" [columns]="columns" [autoheight]="true" >
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName', width: 150 },
{ text: 'Contact Title', datafield: 'Title', width: 150 },
{ text: 'City', datafield: 'City', width: 150 },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
let position = this.myGrid.scrollposition();
let left(position.left);
let top(position.top);
alert('Left: ' + left + ", Top: " + top);
}
}
showloadelement None

Shows the data loading image.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
import { jqxButtonComponent } from 'jqwidgets-ng/jqxbutton';
@Component({
selector: 'app-root',
template:
<div>
`<jqxGrid #myGrid
[width]="800" [source]="source" [columns]="columns" [autoheight]="true" >
</jqxGrid>`
<JqxButton style="margin-right 20px;" width="150" (onClick)="showElement()">Show Load Element</JqxButton>
<JqxButton width="150" (onClick)="hideElement()">Hide Load Element</JqxButton>
</div>,
styles: [`
>
.jqx-button {
display: inline-block;
margin-top: 20px;
}
`]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
showElement(e: Event): any {
this.$refs.myGrid.showloadelement();
},
hideElement(e: Event): any {
this.$refs.myGrid.hideloadelement();
}
}
showrowdetails rowBoundIndex

Shows the details of a row.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
import { jqxButtonComponent } from 'jqwidgets-ng/jqxbutton';
@Component({
selector: 'app-root',
template:
<div>
`<jqxGrid #myGrid
[width]="800" [source]="source" [columns]="columns" [autoheight]="true"
[rowdetails]="true" [initrowdetails]="initrowdetails" [rowdetailstemplate]="rowdetailstemplate" >
</jqxGrid>`
<JqxButton style="margin-right 20px;" width="150" (onClick)="showDetails()">Show Row Details</JqxButton>
<JqxButton width="150" (onClick)="hideDetails()">Hide Row Details</JqxButton>
</div>,
styles: [`
>
.jqx-button {
display: inline-block;
margin-top: 20px;
}
`]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public rowdetailstemplate = {
rowdetails: "<div style='margin: 10px;'>Row Details</div>",
rowdetailsheight: 50
};
initrowdetails(e: Event): any {
parentElement.children[0].innerHTML = 'Details: ' + index;
},
showDetails(e: Event): any {
this.$refs.myGrid.showrowdetails(0);
},
hideDetails(e: Event): any {
this.$refs.myGrid.hiderowdetails(0);
}
}
setcolumnindex dataField, index
n

Sets the index of a column in the columns collection.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.setcolumnindex('Title',0);
}
}
setcolumnproperty dataField, propertyName, propertyValue

Sets a property of a column.Possible property names: 'text', 'hidden', 'hideable', 'renderer', 'cellsrenderer', 'align', 'cellsalign', 'cellsformat', 'pinned', 'contenttype', 'resizable', 'filterable', 'editable', 'cellclassname', 'classname', 'width', 'minwidth', 'maxwidth'

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.setcolumnproperty('Title','text','New Name');
}
}
showcolumn dataField

Shows a column.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
import { jqxButtonComponent } from 'jqwidgets-ng/jqxbutton';
@Component({
selector: 'app-root',
template:
<div>
`<jqxGrid #myGrid
[width]="800" [source]="source" [columns]="columns" [autoheight]="true" >
</jqxGrid>`
<JqxButton style="margin-right 20px;" width="100" (onClick)="showColumn()">Show Column</JqxButton>
<JqxButton width="100" (onClick)="hideColumn()">Hide Column</JqxButton>
</div>,
styles: [`
>
.jqx-button {
display: inline-block;
margin-top: 20px;
}
`]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName'},
{ text: 'Contact Title', datafield: 'Title'},
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
showColumn(e: Event): any {
this.$refs.myGrid.showcolumn('ContactName');
},
hideColumn(e: Event): any {
this.$refs.myGrid.hidecolumn('ContactName');
}
}
unpincolumn dataField

Unpins the column.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
import { jqxButtonComponent } from 'jqwidgets-ng/jqxbutton';
@Component({
selector: 'app-root',
template:
<div>
`<jqxGrid #myGrid
[width]="800" [source]="source" [columns]="columns" [autoheight]="true" >
</jqxGrid>`
<JqxButton style="margin-right 20px;" width="100" (onClick)="pinColumn()">Pin Column</JqxButton>
<JqxButton width="100" (onClick)="unpinColumn()">Unpin Column</JqxButton>
</div>,
styles: [`
>
.jqx-button {
display: inline-block;
margin-top: 20px;
}
`]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
pinColumn(e: Event): any {
this.$refs.myGrid.pincolumn('ContactName');
},
unpinColumn(e: Event): any {
this.$refs.myGrid.unpincolumn('ContactName');
}
}
updatebounddata type

Updates the bound data and refreshes the grid. You can pass 'filter' or 'sort' as parameter, if the update reason is change in 'filtering' or 'sorting'. To update only the data without the columns, use the 'data' parameter. To make a quick update of the cells, pass "cells" as parameter. Passing "cells" will refresh only the cells values when the new rows count is equal to the previous rows count. To make a full update, do not pass any parameter.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.updatebounddata();
}
}
updating None

Gets the updating operation state. Returns a boolean value.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.updating();
}
}
getsortcolumn None

Gets the sort column. Returns the column's datafield or null, if sorting is not applied.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.setOptions({ sortable: true });
this.myGrid.getsortcolumn();
}
}
removesort None

Removes the sorting.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
import { jqxButtonComponent } from 'jqwidgets-ng/jqxbutton';
@Component({
selector: 'app-root',
template:
<div>
`<jqxGrid #myGrid
[width]="850" [source]="source" [columns]="columns" [sortable]="true" [autoheight]="true" >
</jqxGrid>`
<JqxButton style="margin-top 20px;" width="150" (onClick)="removeSort()">Remove Sort</JqxButton>
</div>,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
removeSort(e: Event): any {
this.$refs.myGrid.removesort();
}
}
sortby dataField, sortOrder

Sorts the Grid data.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.setOptions({ sortable: true });
this.myGrid.sortby('ContactName','asc');
}
}
addgroup dataField

Groups by a column.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
import { jqxButtonComponent } from 'jqwidgets-ng/jqxbutton';
@Component({
selector: 'app-root',
template:
<div>
`<jqxGrid #myGrid
[width]="800" [source]="source" [columns]="columns" [groupable]="true" [autoheight]="true" >
</jqxGrid>`
<JqxButton style="margin-right 20px;" width="100" (onClick)="addGroup()">Add Group</JqxButton>
<JqxButton width="100" (onClick)="removeGroup()">Remove Group</JqxButton>
</div>,
styles: [`
>
.jqx-button {
display: inline-block;
margin-top: 20px;
}
`]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
addGroup(e: Event): any {
this.$refs.myGrid.addgroup('ContactName');
},
removeGroup(e: Event): any {
this.$refs.myGrid.removegroup('ContactName');
}
}
cleargroups None

Clears all groups.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
import { jqxButtonComponent } from 'jqwidgets-ng/jqxbutton';
@Component({
selector: 'app-root',
template:
<div>
`<jqxGrid #myGrid
[width]="800" [source]="source" [columns]="columns" [groupable]="true" [autoheight]="true" >
</jqxGrid>`
<JqxButton style="margin-top 20px;" width="100" (onClick)="clearGroups()">Clear Groups</JqxButton>
</div>,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
clearGroups(e: Event): any {
this.$refs.myGrid.cleargroups();
}
}
collapsegroup group

Collapses a group.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
import { jqxButtonComponent } from 'jqwidgets-ng/jqxbutton';
@Component({
selector: 'app-root',
template:
<div>
`<jqxGrid #myGrid
[width]="800" [source]="source" [columns]="columns" [groupable]="true" [groups]=" ['ContactName'] " [autoheight]="true" >
</jqxGrid>`
<JqxButton style="margin-right 20px;" width="100" (onClick)="expandGroup()">Expand Group</JqxButton>
<JqxButton width="100" (onClick)="collapseGroup()">Collapse Group</JqxButton>
</div>,
styles: [`
>
.jqx-button {
display: inline-block;
margin-top: 20px;
}
`]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
expandGroup(e: Event): any {
this.$refs.myGrid.expandgroup(0);
},
collapseGroup(e: Event): any {
this.$refs.myGrid.collapsegroup(0);
}
}
collapseallgroups None

Collapses all groups.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
import { jqxButtonComponent } from 'jqwidgets-ng/jqxbutton';
@Component({
selector: 'app-root',
template:
<div>
`<jqxGrid #myGrid
[width]="800" [source]="source" [columns]="columns" [groupable]="true" [groups]=" ['ContactName'] " [autoheight]="true" >
</jqxGrid>`
<JqxButton style="margin-right 20px;" width="110" (onClick)="expandGroup()">Expand Groups</JqxButton>
<JqxButton width="110" (onClick)="collapseGroup()">Collapse Groups</JqxButton>
</div>,
styles: [`
>
.jqx-button {
display: inline-block;
margin-top: 20px;
}
`]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
expandGroup(e: Event): any {
this.$refs.myGrid.expandallgroups();
},
collapseGroup(e: Event): any {
this.$refs.myGrid.collapseallgroups();
}
}
expandallgroups None

Expands all groups.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
import { jqxButtonComponent } from 'jqwidgets-ng/jqxbutton';
@Component({
selector: 'app-root',
template:
<div>
`<jqxGrid #myGrid
[width]="800" [source]="source" [columns]="columns" [groupable]="true" [groups]=" ['ContactName'] " [autoheight]="true" >
</jqxGrid>`
<JqxButton style="margin-right 20px;" width="110" (onClick)="expandGroup()">Expand Groups</JqxButton>
<JqxButton width="110" (onClick)="collapseGroup()">Collapse Groups</JqxButton>
</div>,
styles: [`
>
.jqx-button {
display: inline-block;
margin-top: 20px;
}
`]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
expandGroup(e: Event): any {
this.$refs.myGrid.expandallgroups();
},
collapseGroup(e: Event): any {
this.$refs.myGrid.collapseallgroups();
}
}
expandgroup group

Expands a group.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
import { jqxButtonComponent } from 'jqwidgets-ng/jqxbutton';
@Component({
selector: 'app-root',
template:
<div>
`<jqxGrid #myGrid
[width]="800" [source]="source" [columns]="columns" [groupable]="true" [groups]=" ['ContactName'] " [autoheight]="true" >
</jqxGrid>`
<JqxButton style="margin-right 20px;" width="100" (onClick)="expandGroup()">Expand Group</JqxButton>
<JqxButton width="100" (onClick)="collapseGroup()">Collapse Group</JqxButton>
</div>,
styles: [`
>
.jqx-button {
display: inline-block;
margin-top: 20px;
}
`]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
expandGroup(e: Event): any {
this.$refs.myGrid.expandgroup(0);
},
collapseGroup(e: Event): any {
this.$refs.myGrid.collapsegroup(0);
}
}
getrootgroupscount None

Gets the number of root groups.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.setOptions({ groupable: true, groups: ['ContactName'] });
this.myGrid.getrootgroupscount();
}
}
getgroup groupIndex

Gets a group. The method returns an object with details about the Group. The object has the following fields:

  • group - group's name.
  • level - group's level in the group's hierarchy.
  • expanded - group's expand state.
  • subgroups - an array of sub groups or null.
  • subrows - an array of rows or null.
import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.setOptions({ groupable: true, groups: ['ContactName'] });
this.myGrid.getgroup(0);
}
}
insertgroup groupIndex, dataField

Groups by a column.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.setOptions({ groupable: true, groups: ['ContactName'] });
this.myGrid.insertgroup(0,'Title');
}
}
iscolumngroupable None

Gets whether the user can group by a column. Returns a boolean value.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.setOptions({ groupable: true });
this.myGrid.iscolumngroupable('ContactName');
}
}
removegroupat groupIndex

Removes a group at specific index.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
import { jqxButtonComponent } from 'jqwidgets-ng/jqxbutton';
@Component({
selector: 'app-root',
template:
<div>
`<jqxGrid #myGrid
[width]="800" [source]="source" [columns]="columns" [groupable]="true" [autoheight]="true" >
</jqxGrid>`
<JqxButton style="margin-top 20px;" width="150" (onClick)="removeGroupAt()">Remove First Group</JqxButton>
</div>,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
removeGroupAt(e: Event): any {
this.$refs.myGrid.removegroupat('0');
}
}
removegroup dataField

Removes a group.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
import { jqxButtonComponent } from 'jqwidgets-ng/jqxbutton';
@Component({
selector: 'app-root',
template:
<div>
`<jqxGrid #myGrid
[width]="800" [source]="source" [columns]="columns" [groupable]="true" [autoheight]="true" >
</jqxGrid>`
<JqxButton style="margin-right 20px;" width="100" (onClick)="addGroup()">Add Group</JqxButton>
<JqxButton width="100" (onClick)="removeGroup()">Remove Group</JqxButton>
</div>,
styles: [`
>
.jqx-button {
display: inline-block;
margin-top: 20px;
}
`]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
addGroup(e: Event): any {
this.$refs.myGrid.addgroup('ContactName');
},
removeGroup(e: Event): any {
this.$refs.myGrid.removegroup('ContactName');
}
}
addfilter dataField, filterGroup, refreshGrid

Adds a filter to the Grid.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]="850" [source]="source" [columns]="columns" [filterable]="true" [autoheight]="true" >
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
let filtergroup = new jqx.filter();
let filter_or_operator(1);
let filtervalue('Maria');
let filtercondition('contains');
let filter = filtergroup.createfilter('stringfilter', filtervalue, filtercondition);
filtergroup.addfilter(filter_or_operator, filter);
this.myGrid.addfilter('ContactName', filtergroup);
this.myGrid.applyfilters();
}
}
applyfilters None

Applies all filters to the Grid.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]="850" [source]="source" [columns]="columns" [filterable]="true" [autoheight]="true" >
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
let filtergroup = new jqx.filter();
let filter_or_operator(1);
let filtervalue('Maria');
let filtercondition('contains');
let filter = filtergroup.createfilter('stringfilter', filtervalue, filtercondition);
filtergroup.addfilter(filter_or_operator, filter);
this.myGrid.addfilter('ContactName', filtergroup);
this.myGrid.applyfilters();
}
}
clearfilters None

Clears all filters from the Grid. You can call the method with optional boolean parameter. If the parameter is "true" or you call the method without parameter, the Grid will clear the filters and refresh the Grid(default behavior). If the parameter is "false", the method will clear the filters without refreshing the Grid.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
import { jqxButtonComponent } from 'jqwidgets-ng/jqxbutton';
@Component({
selector: 'app-root',
template:
<div>
`<jqxGrid #myGrid
[width]="800" [source]="source" [columns]="columns" [filterable]="true" [autoheight]="true" >
</jqxGrid>`
<JqxButton style="margin-top 20px;" width="100" (onClick)="clearFilters()">Clear Filters</JqxButton>
</div>,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
clearFilters(e: Event): any {
this.$refs.myGrid.clearfilters();
}
}
getfilterinformation None

Gets the information about the Grid filters. The method returns an array of the applied filters. The returned information includes the filter objects and filter columns. Each filter in the Array has the following fields:

  • filter - a filter object which may contain one or more filters.
    Properties and Methods of the filter object.
    • getfilters - returns an array of all filters in the filter object. Each filter in the Array has:
      • value - filter's value.
      • id - filter's id.
      • condition - filter's operator. For string filter the value could be: 'EMPTY', 'NOT_EMPTY', 'CONTAINS', 'CONTAINS_CASE_SENSITIVE', 'DOES_NOT_CONTAIN', 'DOES_NOT_CONTAIN_CASE_SENSITIVE', 'STARTS_WITH', 'STARTS_WITH_CASE_SENSITIVE', 'ENDS_WITH', 'ENDS_WITH_CASE_SENSITIVE', 'EQUAL', 'EQUAL_CASE_SENSITIVE', 'NULL', 'NOT_NULL. For Date and number filter the value could be: 'EQUAL', 'NOT_EQUAL', 'LESS_THAN', 'LESS_THAN_OR_EQUAL', 'GREATER_THAN', 'GREATER_THAN_OR_EQUAL', 'NULL', 'NOT_NULL'. For boolean filter, the value could be: 'EQUAL', 'NOT_EQUAL'
      • type - filter's type - 'stringfilter', 'numericfilter', 'booleanfilter' or 'datefilter'.
    • operator - 'and' or 'or'. Determines the connection between the filters in the group.
  • datafield - the column's datafield.
  • displayfield - the column's display field.
import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.setOptions({ filterable: true });
this.myGrid.getfilterinformation();
}
}
getcolumnat index

Method: getcolumnat

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.getcolumnat(3);
}
}
removefilter dataField, refreshGrid

Removes a filter from the Grid.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
import { jqxButtonComponent } from 'jqwidgets-ng/jqxbutton';
@Component({
selector: 'app-root',
template:
<div>
`<jqxGrid #myGrid
[width]="800" [source]="source" [columns]="columns" [filterable]="true" [autoheight]="true" >
</jqxGrid>`
<JqxButton style="margin-top 20px;" width="200" (onClick)="removeFilter()">Remove Contact Name Filter</JqxButton>
</div>,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
removeFilter(e: Event): any {
this.$refs.myGrid.removefilter('ContactName');
}
}
refreshfilterrow None

Refreshes the filter row and updates the filter widgets. The filter row's widgets are synchronized with the applied filters.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
import { jqxButtonComponent } from 'jqwidgets-ng/jqxbutton';
@Component({
selector: 'app-root',
template:
<div>
`<jqxGrid #myGrid
[width]="800" [source]="source" [columns]="columns" [filterable]="true" [showfilterrow]="true" [autoheight]="true" >
</jqxGrid>`
<JqxButton style="margin-top 20px;" width="200" (onClick)="refresh()">Refresh filter row</JqxButton>
</div>,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
addFilters(e: Event): any {
let filtergroup = new jqx.filter();
let filter_or_operator = 1;
let filtervalue = 'Maria';
let filtercondition = 'contains';
let filter = filtergroup.createfilter('stringfilter', filtervalue, filtercondition);
filtergroup.addfilter(filter_or_operator, filter);
this.$refs.myGrid.addfilter('ContactName', filtergroup);
this.$refs.myGrid.applyfilters();
},
refresh(e: Event): any {
this.addFilters()
this.$refs.myGrid.refreshfilterrow();
}
}
gotopage pagenumber

Navigates to a page when the Grid paging is enabled i.e when the pageable property value is true.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.setOptions({ pageable: true, pagesize: 1 });
this.myGrid.gotopage(2);
}
}
gotoprevpage None

Navigates to a previous page when the Grid paging is enabled i.e when the pageable property value is true.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
import { jqxButtonComponent } from 'jqwidgets-ng/jqxbutton';
@Component({
selector: 'app-root',
template:
<div>
`<jqxGrid #myGrid
[width]="800" [source]="source" [columns]="columns" [pageable]="true" [pagesize]="1" [autoheight]="true" >
</jqxGrid>`
<JqxButton style="margin-right 20px;margin-top 20px;" width="100" (onClick)="prevPage()">Previous Page</JqxButton>
<JqxButton style="margin-top 20px;" width="100" (onClick)="nextPage()">Next Page</JqxButton>
</div>,
styles: [`
>
.jqx-button {
display: inline-block;
}
`]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
prevPage(e: Event): any {
this.$refs.myGrid.gotoprevpage();
},
nextPage(e: Event): any {
this.$refs.myGrid.gotonextpage();
}
}
gotonextpage None

Navigates to a next page when the Grid paging is enabled i.e when the pageable property value is true.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
import { jqxButtonComponent } from 'jqwidgets-ng/jqxbutton';
@Component({
selector: 'app-root',
template:
<div>
`<jqxGrid #myGrid
[width]="800" [source]="source" [columns]="columns" [pageable]="true" [pagesize]="1" [autoheight]="true" >
</jqxGrid>`
<JqxButton style="margin-right 20px;margin-top 20px;" width="100" (onClick)="prevPage()">Previous Page</JqxButton>
<JqxButton style="margin-top 20px;" width="100" (onClick)="nextPage()">Next Page</JqxButton>
</div>,
styles: [`
>
.jqx-button {
display: inline-block;
}
`]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
prevPage(e: Event): any {
this.$refs.myGrid.gotoprevpage();
},
nextPage(e: Event): any {
this.$refs.myGrid.gotonextpage();
}
}
addrow rowIds, data, rowPosition

Adds a new row or multiple rows.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.addrow(1,{});
}
}
begincelledit rowBoundIndex, dataField

Shows the cell's editor.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
import { jqxButtonComponent } from 'jqwidgets-ng/jqxbutton';
@Component({
selector: 'app-root',
template:
<div>
`<jqxGrid #myGrid
[width]="800" [source]="source" [columns]="columns" [editable]="true" [autoheight]="true" >
</jqxGrid>`
<JqxButton style="margin-right 20px;margin-top 20px;" width="100" (onClick)="beginEdit()">Begin Cell Edit</JqxButton>
<JqxButton style="margin-top 20px;" width="100" (onClick)="endEdit()">End Cell Edit</JqxButton>
</div>,
styles: [`
>
.jqx-button {
display: inline-block;
}
`]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
beginEdit(e: Event): any {
this.$refs.myGrid.begincelledit(1, 'Title');
},
endEdit(e: Event): any {
this.$refs.myGrid.endcelledit(1, 'Title', true);
}
}
beginrowedit rowBoundIndex

Shows the cell editors for an entire row.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
import { jqxButtonComponent } from 'jqwidgets-ng/jqxbutton';
@Component({
selector: 'app-root',
template:
<div>
`<jqxGrid #myGrid
[width]="800" [source]="source" [columns]="columns" [editable]="true" [autoheight]="true" >
</jqxGrid>`
<JqxButton style="margin-right 20px;margin-top 20px;" width="100" (onClick)="beginEdit()">Begin Row Edit</JqxButton>
<JqxButton style="margin-top 20px;" width="100" (onClick)="endEdit()">End Row Edit</JqxButton>
</div>,
styles: [`
>
.jqx-button {
display: inline-block;
}
`]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
beginEdit(e: Event): any {
this.$refs.myGrid.beginrowedit(1);
},
endEdit(e: Event): any {
this.$refs.myGrid.endrowedit(1, true);
}
}
closemenu None

Closes a column's menu.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
import { jqxButtonComponent } from 'jqwidgets-ng/jqxbutton';
@Component({
selector: 'app-root',
template:
<div>
`<jqxGrid #myGrid
[width]="800" [source]="source" [columns]="columns" [filterable]="true" [autoheight]="true" >
</jqxGrid>`
<JqxButton style="margin-right 20px; margin-top 20px;" width="100" (onClick)="openMenu()">Open Menu</JqxButton>
<JqxButton style="margin-top 20px;" width="100" (onClick)="closeMenu()">Close Menu</JqxButton>
</div>,
styles: [`
>
.jqx-button {
display: inline-block;
}
`]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
openMenu(e: Event): any {
this.$refs.myGrid.openmenu('ContactName');
},
closeMenu(e: Event): any {
this.$refs.myGrid.closemenu();
}
}
deleterow rowIds

Deletes a row or multiple rows. Returns a boolean value.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.deleterow(1);
}
}
endcelledit rowBoundIndex, dataField, confirmChanges

Hides the edit cell's editor and saves or cancels the changes.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
import { jqxButtonComponent } from 'jqwidgets-ng/jqxbutton';
@Component({
selector: 'app-root',
template:
<div>
`<jqxGrid #myGrid
[width]="800" [source]="source" [columns]="columns" [editable]="true" [autoheight]="true" >
</jqxGrid>`
<JqxButton style="margin-right 20px;margin-top 20px;" width="100" (onClick)="beginEdit()">Begin Cell Edit</JqxButton>
<JqxButton style="margin-top 20px;" width="100" (onClick)="endEdit()">End Cell Edit</JqxButton>
</div>,
styles: [`
>
.jqx-button {
display: inline-block;
}
`]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
beginEdit(e: Event): any {
this.$refs.myGrid.begincelledit(1, 'Title');
},
endEdit(e: Event): any {
this.$refs.myGrid.endcelledit(1, 'Title', true);
}
}
endrowedit rowBoundIndex, confirmChanges

Hides the edited row's editors and saves or cancels the changes.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
import { jqxButtonComponent } from 'jqwidgets-ng/jqxbutton';
@Component({
selector: 'app-root',
template:
<div>
`<jqxGrid #myGrid
[width]="800" [source]="source" [columns]="columns" [editable]="true" [autoheight]="true" >
</jqxGrid>`
<JqxButton style="margin-right 20px;margin-top 20px;" width="100" (onClick)="beginEdit()">Begin Row Edit</JqxButton>
<JqxButton style="margin-top 20px;" width="100" (onClick)="endEdit()">End Row Edit</JqxButton>
</div>,
styles: [`
>
.jqx-button {
display: inline-block;
}
`]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
beginEdit(e: Event): any {
this.$refs.myGrid.beginrowedit(1);
},
endEdit(e: Event): any {
this.$refs.myGrid.endrowedit(1, true);
}
}
getcell rowBoundIndex, datafield

Gets a cell. Returns an object with the following fields:

  • value - cell's value.
  • row - cell's row number.
  • column - column's datafield.
import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.getcell(1,'ContactName');
}
}
getcellatposition left, top

Gets a cell at specific position. Returns an object with the following fields:

  • value - cell's value.
  • row - cell's row number.
  • column - column's datafield.
import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.getcellatposition(10,100);
}
}
getcelltext rowBoundIndex, dataField

Gets the text of a cell.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.getcelltext(1,'ContactName');
}
}
getcelltextbyid rowID, dataField

Gets the text of a cell.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.getcelltextbyid(1,'ContactName');
}
}
getcellvaluebyid rowID, dataField

Gets the value of a cell.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.getcellvaluebyid(1,'ContactName');
}
}
getcellvalue rowBoundIndex, dataField

Gets the value of a cell.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.getcellvalue(1,'ContactName');
}
}
isBindingCompleted None

Returns whether the binding is completed and if the result is true, this means that you can invoke methods and set properties. Otherwise, if the binding is not completed and you try to set a property or invoke a method, the widget will throw an exception.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.isBindingCompleted();
}
}
openmenu dataField

Displays a column's menu.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
import { jqxButtonComponent } from 'jqwidgets-ng/jqxbutton';
@Component({
selector: 'app-root',
template:
<div>
`<jqxGrid #myGrid
[width]="800" [source]="source" [columns]="columns" [filterable]="true" [autoheight]="true" >
</jqxGrid>`
<JqxButton style="margin-right 20px; margin-top 20px;" width="100" (onClick)="openMenu()">Open Menu</JqxButton>
<JqxButton style="margin-top 20px;" width="100" (onClick)="closeMenu()">Close Menu</JqxButton>
</div>,
styles: [`
>
.jqx-button {
display: inline-block;
}
`]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
openMenu(e: Event): any {
this.$refs.myGrid.openmenu('ContactName');
},
closeMenu(e: Event): any {
this.$refs.myGrid.closemenu();
}
}
setcellvalue rowBoundIndex, dataField, value

Sets a new value to a cell.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.setcellvalue(1,'ContactName','New Name');
}
}
setcellvaluebyid rowID, dataField, value

Sets a new value to a cell.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.setcellvaluebyid(1,'ContactName','New Name');
}
}
showvalidationpopup rowBoundIndex, dataField, validationMessage

Displays a validation popup below a Grid cell.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.showvalidationpopup(1,'ContactName','Error message');
}
}
updaterow rowIds, data

Updates a row or multiple rows.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.updaterow(1,{ContactName: 'New Name'});
}
}
clearselection None

Clears the selection.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
import { jqxButtonComponent } from 'jqwidgets-ng/jqxbutton';
@Component({
selector: 'app-root',
template:
<div>
`<jqxGrid #myGrid
[width]="800" [source]="source" [columns]="columns" [selectionmode]="'multiplecells'" [autoheight]="true" >
</jqxGrid>`
<JqxButton width="200" (onClick)="clearSelection()">Clear Selection</JqxButton>
</div>,
styles: [`
>
.jqx-button {
margin-top: 20px;
}
`]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
clearSelection(e: Event): any {
this.$refs.myGrid.clearselection();
}
}
getselectedrowindex None

The expected selection mode is 'singlerow', 'multiplerows' or 'multiplerowsextended'

Gets the bound index of the selected row. Returns -1, if there's no selection.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
import { jqxButtonComponent } from 'jqwidgets-ng/jqxbutton';
@Component({
selector: 'app-root',
template:
<div>
`<jqxGrid #myGrid
[width]="800" [source]="source" [columns]="columns" [autoheight]="true" >
</jqxGrid>`
<JqxButton style="margin-right 20px;" width="100" (onClick)="select()">Select row</JqxButton>
<JqxButton style="margin-right 20px;" width="100" (onClick)="unselect()">Unselect Row</JqxButton>
<JqxButton width="160" (onClick)="getSelected()">Get selected row index</JqxButton>
</div>,
styles: [`
>
.jqx-button {
display: inline-block;
margin-top: 20px;
}
`]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
select(e: Event): any {
this.$refs.myGrid.selectrow(1);
},
unselect(e: Event): any {
this.$refs.myGrid.unselectrow(1);
},
getSelected(e: Event): any {
const selected = this.$refs.myGrid.getselectedrowindex();
console.log(selected);
}
}
getselectedrowindexes None

The expected selection mode is 'singlerow', 'multiplerows' or 'multiplerowsextended'

Gets the indexes of the selected rows. Returns an array of the selected rows.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
import { jqxButtonComponent } from 'jqwidgets-ng/jqxbutton';
@Component({
selector: 'app-root',
template:
<div>
`<jqxGrid #myGrid
[width]="800" [source]="source" [columns]="columns" [selectionmode]="'multiplerows'" [autoheight]="true" >
</jqxGrid>`
<JqxButton width="200" (onClick)="getSelectedRowIndexes()">Get selected row indexes</JqxButton>
</div>,
styles: [`
>
.jqx-button {
margin-top: 20px;
}
`]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
getSelectedRowIndexes(e: Event): any {
const selected = this.$refs.myGrid.getselectedrowindexes();
console.log(selected);
}
}
getselectedcell None

The expected selection mode is 'singlecell', 'multiplecells' or 'multiplecellsextended'

Gets the selected cell. The returned value is an object with two fields: 'rowindex' - the row's bound index and 'datafield' - the column's datafield.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
import { jqxButtonComponent } from 'jqwidgets-ng/jqxbutton';
@Component({
selector: 'app-root',
template:
<div>
`<jqxGrid #myGrid
[width]="800" [source]="source" [columns]="columns" [selectionmode]="'singlecell'" [autoheight]="true" >
</jqxGrid>`
<JqxButton style="margin-right 20px;" width="100" (onClick)="select()">Select cell</JqxButton>
<JqxButton style="margin-right 20px;" width="100" (onClick)="unselect()">Unselect Cell</JqxButton>
<JqxButton width="140" (onClick)="getSelected()">Get selected cell</JqxButton>
</div>,
styles: [`
>
.jqx-button {
display: inline-block;
margin-top: 20px;
}
`]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
select(e: Event): any {
this.$refs.myGrid.selectcell(1, 'ContactName');
},
unselect(e: Event): any {
this.$refs.myGrid.unselectcell(1, 'ContactName');
},
getSelected(e: Event): any {
const selected = this.$refs.myGrid.getselectedcell();
console.log(selected);
}
}
getselectedcells None

The expected selection mode is 'singlecell', 'multiplecells' or 'multiplecellsextended'

Gets all selected cells. Returns an array of all selected cells. Each cell in the array is an object with two fields: 'rowindex' - the row's bound index and 'datafield' - the column's datafield.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
import { jqxButtonComponent } from 'jqwidgets-ng/jqxbutton';
@Component({
selector: 'app-root',
template:
<div>
`<jqxGrid #myGrid
[width]="800" [source]="source" [columns]="columns" [selectionmode]="'multiplecells'" [autoheight]="true" >
</jqxGrid>`
<JqxButton width="200" (onClick)="getSelectedCells()">Get selected cells</JqxButton>
</div>,
styles: [`
>
.jqx-button {
margin-top: 20px;
}
`]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
getSelectedCells(e: Event): any {
const selected = this.$refs.myGrid.getselectedcells();
console.log(selected);
}
}
selectcell rowBoundIndex, dataField

The expected selection mode is 'singlecell', 'multiplecells' or 'multiplecellsextended'

Selects a cell.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
import { jqxButtonComponent } from 'jqwidgets-ng/jqxbutton';
@Component({
selector: 'app-root',
template:
<div>
`<jqxGrid #myGrid
[width]="800" [source]="source" [columns]="columns" [selectionmode]="'singlecell'" [autoheight]="true" >
</jqxGrid>`
<JqxButton style="margin-right 20px;" width="100" (onClick)="select()">Select cell</JqxButton>
<JqxButton style="margin-right 20px;" width="100" (onClick)="unselect()">Unselect Cell</JqxButton>
<JqxButton width="140" (onClick)="getSelected()">Get selected cell</JqxButton>
</div>,
styles: [`
>
.jqx-button {
display: inline-block;
margin-top: 20px;
}
`]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
select(e: Event): any {
this.$refs.myGrid.selectcell(1, 'ContactName');
},
unselect(e: Event): any {
this.$refs.myGrid.unselectcell(1, 'ContactName');
},
getSelected(e: Event): any {
const selected = this.$refs.myGrid.getselectedcell();
console.log(selected);
}
}
selectallrows None

The selection mode should be set to: 'multiplerows' or 'multiplerowsextended'

Selects all Grid rows.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.setOptions({ selectionmode: 'multiplerows' });
this.myGrid.selectallrows();
}
}
selectrow rowBoundIndex

The expected selection mode is 'singlerow', 'multiplerows' or 'multiplerowsextended'

Selects a row.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
import { jqxButtonComponent } from 'jqwidgets-ng/jqxbutton';
@Component({
selector: 'app-root',
template:
<div>
`<jqxGrid #myGrid
[width]="800" [source]="source" [columns]="columns" [autoheight]="true" >
</jqxGrid>`
<JqxButton style="margin-right 20px;" width="100" (onClick)="select()">Select row</JqxButton>
<JqxButton style="margin-right 20px;" width="100" (onClick)="unselect()">Unselect Row</JqxButton>
<JqxButton width="160" (onClick)="getSelected()">Get selected row index</JqxButton>
</div>,
styles: [`
>
.jqx-button {
display: inline-block;
margin-top: 20px;
}
`]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
select(e: Event): any {
this.$refs.myGrid.selectrow(1);
},
unselect(e: Event): any {
this.$refs.myGrid.unselectrow(1);
},
getSelected(e: Event): any {
const selected = this.$refs.myGrid.getselectedrowindex();
console.log(selected);
}
}
unselectrow rowBoundIndex

The expected selection mode is 'singlerow', 'multiplerows' or 'multiplerowsextended'

Unselects a row.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
import { jqxButtonComponent } from 'jqwidgets-ng/jqxbutton';
@Component({
selector: 'app-root',
template:
<div>
`<jqxGrid #myGrid
[width]="800" [source]="source" [columns]="columns" [autoheight]="true" >
</jqxGrid>`
<JqxButton style="margin-right 20px;" width="100" (onClick)="select()">Select row</JqxButton>
<JqxButton style="margin-right 20px;" width="100" (onClick)="unselect()">Unselect Row</JqxButton>
<JqxButton width="160" (onClick)="getSelected()">Get selected row index</JqxButton>
</div>,
styles: [`
>
.jqx-button {
display: inline-block;
margin-top: 20px;
}
`]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
select(e: Event): any {
this.$refs.myGrid.selectrow(1);
},
unselect(e: Event): any {
this.$refs.myGrid.unselectrow(1);
},
getSelected(e: Event): any {
const selected = this.$refs.myGrid.getselectedrowindex();
console.log(selected);
}
}
unselectcell rowBoundIndex, dataField

The expected selection mode is 'singlecell', 'multiplecells' or 'multiplecellsextended'

Unselects a cell.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
import { jqxButtonComponent } from 'jqwidgets-ng/jqxbutton';
@Component({
selector: 'app-root',
template:
<div>
`<jqxGrid #myGrid
[width]="800" [source]="source" [columns]="columns" [selectionmode]="'singlecell'" [autoheight]="true" >
</jqxGrid>`
<JqxButton style="margin-right 20px;" width="100" (onClick)="select()">Select cell</JqxButton>
<JqxButton style="margin-right 20px;" width="100" (onClick)="unselect()">Unselect Cell</JqxButton>
<JqxButton width="140" (onClick)="getSelected()">Get selected cell</JqxButton>
</div>,
styles: [`
>
.jqx-button {
display: inline-block;
margin-top: 20px;
}
`]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
select(e: Event): any {
this.$refs.myGrid.selectcell(1, 'ContactName');
},
unselect(e: Event): any {
this.$refs.myGrid.unselectcell(1, 'ContactName');
},
getSelected(e: Event): any {
const selected = this.$refs.myGrid.getselectedcell();
console.log(selected);
}
}
getcolumnaggregateddata dataField, aggregates

Gets the aggregated data of a Grid column. Returns a JSON object. Each field name is the aggregate's type('min', 'max', 'sum', etc.).

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]="800" [source]="source" [columns]="columns" [showaggregates]="true" [showstatusbar]="true" [autoheight]="true" >
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title', aggregates: ['count'] },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country', aggregates: ['count'] }
];
}
refreshaggregates None

Refreshes the Aggregates in the Grid's status bar.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]="800" [source]="source" [columns]="columns" [showaggregates]="true" [showstatusbar]="true" [autoheight]="true" >
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title', aggregates: ['count'] },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country', aggregates: ['count'] }
];
}
renderaggregates None

Renders the aggregates in the Grid's status bar.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]="800" [source]="source" [columns]="columns" [showaggregates]="true" [showstatusbar]="true" [autoheight]="true" >
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title', aggregates: ['count'] },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country', aggregates: ['count'] }
];
}
exportdata dataType, fileName, exportHeader, rows, exportHiddenColumns, serverURL, charSet

Exports all rows loaded within the Grid to Excel, XML, CSV, TSV, HTML or JSON.

var data = $("#jqxgrid").jqxGrid('exportdata', 'json');
import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.exportdata('xls','grid');
}
}
exportview dataType, fileName

Exports the view Grid to Excel, PDF, XML, CSV, TSV, HTML or JSON.

var data = $("#jqxgrid").jqxGrid('exportview', 'xlsx', 'grid');
import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.exportview('xlsx','grid');
}
}
openColumnChooser columns, header

Opens the Grid's column chooser

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
@Component({
selector: 'app-root',
template:
`<jqxGrid #myGrid
[width]='850' [source]='dataAdapter' [columns]='columns' [autoheight]='true'>
</jqxGrid>`,
styles: [``]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
[ 'Maria Anders', 'Sales Representative', 'Berlin', 'Germany' ],
[ 'Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico' ],
[ 'Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico' ]
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
public ngAfterViewInit(): void {
this.myGrid.openColumnChooser();
}
}
getstate None

Gets the Grid's state. the getstate method gets the following information: 'sort column, sort order, page number, page size, applied filters and filter row values, column widths and visibility, cells and rows selection and groups.

  • width - the Grid's width.
  • height - the Grid's height.
  • pagenum - the Grid's page number.
  • pagesize - the Grid's page size.
  • pagesizeoptions - the Grid's page size options - an array of the available page sizes.
  • sortcolumn - the Grid's sort column. The value is the column's datafield or null, if sorting is not applied.
  • sortdirection - JSON object with two boolean fields: 'ascending' and 'descending'.
  • filters - the applied filters. See the 'getfilterinformation' method.
  • groups - the Grid's groups array which contains the grouped columns data fields.
  • columns - an array of Columns. Each column in the array has the following fields:
    • width - column's width.
    • hidden - column's visible state.
    • pinned - column's pinned state.
    • groupable - column's groupable state.
    • resizable - column's resizable state.
    • draggable - column's draggable state.
    • text - column's text.
    • align - column's align.
    • cellsalign - column's cells align.
import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
import { jqxButtonComponent } from 'jqwidgets-ng/jqxbutton';
@Component({
selector: 'app-root',
template:
<div>
`<jqxGrid #myGrid
[width]="800" [source]="source" [columns]="columns" [sortable]="true" [filterable]="true" [autoheight]="true" >
</jqxGrid>`
<JqxButton style="margin-right 20px; margin-top 20px;" width="100" (onClick)="savestate()">Save state</JqxButton>
<JqxButton style="margin-right 20px; margin-top 20px;" width="100" (onClick)="loadstate()">Load State</JqxButton>
<JqxButton style="margin-top 20px;" width="100" (onClick)="getstate()">Get state</JqxButton>
</div>,
styles: [`
>
.jqx-button {
display: inline-block;
}
`]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
savestate(e: Event): any {
this.$refs.myGrid.savestate();
},
loadstate(e: Event): any {
this.$refs.myGrid.loadstate();
},
getstate(e: Event): any {
const state = this.$refs.myGrid.getstate();
console.log(state);
}
}
loadstate stateobject

Loads the Grid's state. the loadstate method loads the following information: 'sort column, sort order, page number, page size, applied filters and filter row values, column widths and visibility, cells and rows selection and groups.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
import { jqxButtonComponent } from 'jqwidgets-ng/jqxbutton';
@Component({
selector: 'app-root',
template:
<div>
`<jqxGrid #myGrid
[width]="800" [source]="source" [columns]="columns" [sortable]="true" [filterable]="true" [autoheight]="true" >
</jqxGrid>`
<JqxButton style="margin-right 20px; margin-top 20px;" width="100" (onClick)="savestate()">Save state</JqxButton>
<JqxButton style="margin-right 20px; margin-top 20px;" width="100" (onClick)="loadstate()">Load State</JqxButton>
<JqxButton style="margin-top 20px;" width="100" (onClick)="getstate()">Get state</JqxButton>
</div>,
styles: [`
>
.jqx-button {
display: inline-block;
}
`]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
savestate(e: Event): any {
this.$refs.myGrid.savestate();
},
loadstate(e: Event): any {
this.$refs.myGrid.loadstate();
},
getstate(e: Event): any {
const state = this.$refs.myGrid.getstate();
console.log(state);
}
}
savestate None

Saves the Grid's current state. the savestate method saves the following information: 'sort column, sort order, page number, page size, applied filters and filter row values, column widths and visibility, cells and rows selection and groups.

import { Component, ViewChild } from '@angular/core';
import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid';
import { jqxButtonComponent } from 'jqwidgets-ng/jqxbutton';
@Component({
selector: 'app-root',
template:
<div>
`<jqxGrid #myGrid
[width]="800" [source]="source" [columns]="columns" [sortable]="true" [filterable]="true" [autoheight]="true" >
</jqxGrid>`
<JqxButton style="margin-right 20px; margin-top 20px;" width="100" (onClick)="savestate()">Save state</JqxButton>
<JqxButton style="margin-right 20px; margin-top 20px;" width="100" (onClick)="loadstate()">Load State</JqxButton>
<JqxButton style="margin-top 20px;" width="100" (onClick)="getstate()">Get state</JqxButton>
</div>,
styles: [`
>
.jqx-button {
display: inline-block;
}
`]
})
export class AppComponent {
@ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;
public source = {
localdata: [
['Maria Anders', 'Sales Representative', 'Berlin', 'Germany'],
['Ana Trujillo', 'Owner', 'Mxico D.F.', 'Mexico'],
['Antonio Moreno', 'Owner', 'Mxico D.F.', 'Mexico']
],
datafields: [
{ name: 'ContactName', type: 'string', map: '0' },
{ name: 'Title', type: 'string', map: '1' },
{ name: 'City', type: 'string', map: '2' },
{ name: 'Country', type: 'string', map: '3' }
],
datatype: 'array'
};
public dataAdapter = new jqx.dataAdapter(this.source);
public columns = [
{ text: 'Contact Name', datafield: 'ContactName' },
{ text: 'Contact Title', datafield: 'Title' },
{ text: 'City', datafield: 'City' },
{ text: 'Country', datafield: 'Country' }
];
savestate(e: Event): any {
this.$refs.myGrid.savestate();
},
loadstate(e: Event): any {
this.$refs.myGrid.loadstate();
},
getstate(e: Event): any {
const state = this.$refs.myGrid.getstate();
console.log(state);
}
}