Update core smartproc
This commit is contained in:
@@ -6,8 +6,8 @@
|
||||
<div class="dx-card responsive-paddings">
|
||||
<div id="app-container">
|
||||
<DxDataGrid ref="currDataGrid"
|
||||
:data-source="customDataSource"
|
||||
key-expr="ID"
|
||||
:data-source="dataSource"
|
||||
key-expr="id"
|
||||
:allow-column-reordering="true"
|
||||
:column-auto-width="true"
|
||||
@exporting="onExporting">
|
||||
@@ -17,7 +17,6 @@
|
||||
:allow-updating="true"
|
||||
:allow-deleting="true"
|
||||
:use-icons="true"
|
||||
form="popup"
|
||||
mode="popup">
|
||||
<DxTexts
|
||||
add-row="Tambah"
|
||||
@@ -28,8 +27,8 @@
|
||||
cancel-row-changes="Batal"
|
||||
></DxTexts>
|
||||
<DxForm label-location="top" :col-count="1">
|
||||
<DxItem dataField="instansi_id" editor-type="dxSelectBox"/>
|
||||
<!--<DxItem dataField="instansix_id" :data-source="instansiEditorOptions" editor-type="dxDropDownBox"/>-->
|
||||
<!--<DxItem dataField="instansiId" editor-type="dxSelectBox"/>-->
|
||||
<DxItem dataField="instansiId"/>
|
||||
<DxItem dataField="bidang">
|
||||
<DxRequiredRule message="Bidang harus diisi" />
|
||||
</DxItem>
|
||||
@@ -63,8 +62,8 @@
|
||||
info-text="Hal {0} dari {1} ({2} data)" />
|
||||
<DxFilterRow :visible="false" />
|
||||
<DxColumn data-field="id" caption="No" :width="45"></DxColumn>
|
||||
<DxColumn data-field="instansi_id" caption="Instansi">
|
||||
<DxLookup display-expr="instansi" value-expr="id" :data-source="instansiEditorOptions" />
|
||||
<DxColumn data-field="instansiId" caption="Instansi">
|
||||
<DxLookup display-expr="instansi" value-expr="id" :data-source="instansis" :search-enabled="true" />
|
||||
</DxColumn>
|
||||
<DxColumn data-field="bidang" caption="Bidang"></DxColumn>
|
||||
<DxColumn data-field="keterangan" caption="Keterangan"></DxColumn>
|
||||
@@ -111,6 +110,8 @@ const URL = process.env.VUE_APP_ROOT_API+'/bidang';
|
||||
const URL_instansi = process.env.VUE_APP_ROOT_API+'/instansi';
|
||||
|
||||
const instansiOptions = new CustomStore({
|
||||
key: 'id',
|
||||
|
||||
load:() => {
|
||||
return fetch(URL_instansi+'?size=1000')
|
||||
.then((response) => response.json())
|
||||
@@ -124,10 +125,22 @@ const instansiOptions = new CustomStore({
|
||||
// console.log(JSON.parse(data));
|
||||
// })
|
||||
.catch(() => { throw new Error('Terdapat kesalahan memuat data'); });
|
||||
},
|
||||
|
||||
byKey: (key) => {
|
||||
return fetch(URL_instansi+'/' + key)
|
||||
.then((response) => response.json())
|
||||
.then(response => {
|
||||
console.log(response.instansi);
|
||||
return {
|
||||
data: response.instansi
|
||||
};
|
||||
})
|
||||
.catch(() => { throw new Error('Terdapat kesalahan memuat data'); });
|
||||
}
|
||||
});
|
||||
|
||||
const customDataSource = new CustomStore({
|
||||
const dataSource = new CustomStore({
|
||||
key: 'id',
|
||||
|
||||
load: () => {
|
||||
@@ -233,11 +246,12 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
//jsonUrl: URL,
|
||||
customDataSource,
|
||||
instansiEditorOptions: {
|
||||
items: instansiOptions,
|
||||
searchEnabled: true, value: ''
|
||||
},
|
||||
dataSource,
|
||||
instansis: instansiOptions,
|
||||
// instansis: {
|
||||
// items: instansiOptions,
|
||||
// searchEnabled: true, value: ''
|
||||
// },
|
||||
}
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user