Add row-prepared event handler to Table_70.vue
This commit is contained in:
parent
9896746b73
commit
7940ff84ac
@ -3,7 +3,7 @@
|
|||||||
<DxDataGrid class="max-h-[calc(100vh-140px)]" :show-column-lines="true" :show-row-lines="false" :show-borders="true"
|
<DxDataGrid class="max-h-[calc(100vh-140px)]" :show-column-lines="true" :show-row-lines="false" :show-borders="true"
|
||||||
:row-alternation-enabled="true" :hover-state-enabled="true" @selection-changed="onSelectionChanged"
|
:row-alternation-enabled="true" :hover-state-enabled="true" @selection-changed="onSelectionChanged"
|
||||||
:column-width="100" @exporting="onExporting" :allow-column-resizing="true" column-resizing-mode="widget"
|
:column-width="100" @exporting="onExporting" :allow-column-resizing="true" column-resizing-mode="widget"
|
||||||
:word-wrap-enabled="true">
|
:word-wrap-enabled="true" @row-prepared="onRowPrepared">
|
||||||
<DxSelection mode="single" />
|
<DxSelection mode="single" />
|
||||||
<DxPaging :enabled="false" />
|
<DxPaging :enabled="false" />
|
||||||
<DxScrolling column-rendering-mode="virtual" mode="virtual" />
|
<DxScrolling column-rendering-mode="virtual" mode="virtual" />
|
||||||
@ -73,4 +73,61 @@ const onSelectionChanged = ({ selectedRowsData }: any) => {
|
|||||||
console.log(data)
|
console.log(data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const onRowPrepared = (e: any) => {
|
||||||
|
if (e.rowType === "data") {
|
||||||
|
if (e.data.Speed > e.data.SpeedLimit) {
|
||||||
|
// e.cellElement.style.cssText = "color: white; background-color: red";
|
||||||
|
// or
|
||||||
|
e.rowElement.classList.add("my-class");
|
||||||
|
// To override alternation color
|
||||||
|
// e.rowElement.className = e.rowElement.className.replace("dx-row-alt", "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const data = [
|
||||||
|
{
|
||||||
|
noLapor: 'K2316081000039',
|
||||||
|
tipeIsu: 'PDPB',
|
||||||
|
nama: 'BAPAK HAIRUL',
|
||||||
|
unit: 'ULP BARABAI',
|
||||||
|
noTelp: '081350000000',
|
||||||
|
permasalahan: 'MCB KWH SERING TURUN',
|
||||||
|
deskripsi: '-',
|
||||||
|
tglBuat: '10/08/2016 07:18:17',
|
||||||
|
lapUlang: 0,
|
||||||
|
ketLapUlang: '-',
|
||||||
|
status: 'Dalam Proses Manager Unit',
|
||||||
|
durasi: '2638 01:59:17'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
noLapor: 'K2316081000039',
|
||||||
|
tipeIsu: 'PDPB',
|
||||||
|
nama: 'BAPAK HAIRUL',
|
||||||
|
unit: 'ULP BARABAI',
|
||||||
|
noTelp: '081350000000',
|
||||||
|
permasalahan: 'MCB KWH SERING TURUN',
|
||||||
|
deskripsi: '-',
|
||||||
|
tglBuat: '10/08/2016 07:18:17',
|
||||||
|
lapUlang: 0,
|
||||||
|
ketLapUlang: '-',
|
||||||
|
status: 'Dalam Proses Manager Unit',
|
||||||
|
durasi: '2638 01:59:17'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
noLapor: 'K2316081000039',
|
||||||
|
tipeIsu: 'PDPB',
|
||||||
|
nama: 'BAPAK HAIRUL',
|
||||||
|
unit: 'ULP BARABAI',
|
||||||
|
noTelp: '081350000000',
|
||||||
|
permasalahan: 'MCB KWH SERING TURUN',
|
||||||
|
deskripsi: '-',
|
||||||
|
tglBuat: '10/08/2016 07:18:17',
|
||||||
|
lapUlang: 0,
|
||||||
|
ketLapUlang: '-',
|
||||||
|
status: 'Dalam Proses Manager Unit',
|
||||||
|
durasi: '2638 01:59:17'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
</script>
|
</script>
|
Loading…
x
Reference in New Issue
Block a user