@@ -100,10 +100,12 @@ import SubjectsEditorComponent from './components/SubjectsEditorComponent.vue';
100100const dataSource = ref <StudentSubject []>(studentSubjects );
101101const studentsData = ref <Student []>(students );
102102const currentSubjects = ref <Subject []>([]);
103- const popupInstance = ref <any >(null ); // DevExtreme popup component instance - keeping as any due to complex DX component typing
103+ // DevExtreme popup component instance - keeping as any due to complex DX component typing
104+ const popupInstance = ref <any >(null );
104105const canBeSaved = ref <boolean >(false );
105106const editingKey = ref <string | number | null >(null );
106- const mainGrid = ref <any >(null ); // DevExtreme DataGrid component instance - keeping as any due to complex DX component typing
107+ // DevExtreme DataGrid component instance - keeping as any due to complex DX component typing
108+ const mainGrid = ref <any >(null );
107109
108110const saveButtonOptions = reactive ({
109111 text: ' Save' ,
@@ -117,23 +119,26 @@ const cancelButtonOptions = reactive({
117119 onClick : () => cancelMainGrid ()
118120});
119121
120- const subjectsCellTemplate = (container : HTMLElement , options : { value? : Subject []; target? : string }) => {
122+ const subjectsCellTemplate = (
123+ container : HTMLElement ,
124+ options : { value? : Subject []; target? : string }
125+ ) => {
121126 if (options .value && options .value .length > 0 ) {
122127 const text = options .value .map ((subject : Subject ) => subject .Name ).join (' , ' );
123128 container .textContent = text ;
124129 }
125130};
126131
127132const onEditingStart = (e : DxDataGridTypes .EditingStartEvent ) => {
128- currentSubjects .value = [... (e .data .Subjects || [])];
133+ currentSubjects .value = [... (e .data .Subjects ?? [])];
129134};
130135
131136const onEditorPreparing = (e : DxDataGridTypes .EditorPreparingEvent ) => {
132- canBeSaved .value = e .row ?.isNewRow || false ;
137+ canBeSaved .value = e .row ?.isNewRow ?? false ;
133138 editingKey .value = e .row ?.key ;
134139};
135140
136- const onInitNewRow = (_e : DxDataGridTypes . InitNewRowEvent ) => {
141+ const onInitNewRow = () => {
137142 currentSubjects .value = [];
138143};
139144
@@ -149,15 +154,17 @@ const onSubjectsChange = (subjects: Subject[]) => {
149154 currentSubjects .value = subjects ;
150155};
151156
152- const onNestedEditingStart = (_e : DxDataGridTypes . EditingStartEvent ) => {
157+ const onNestedEditingStart = () => {
153158 updateSaveButtonState (true );
154159};
155160
156161const onNestedRowValidating = (e : { isValid: boolean }) => {
157162 updateSaveButtonState (! e .isValid );
158163};
159164
160- const onNestedSaved = (e : { component: { getDataSource: () => { items: () => Subject [] } } }) => {
165+ const onNestedSaved = (
166+ e : { component: { getDataSource: () => { items: () => Subject [] } } }
167+ ) => {
161168 currentSubjects .value = e .component .getDataSource ().items ();
162169 const hasSubjects = currentSubjects .value .length > 0 ;
163170 updateSaveButtonState (! hasSubjects );
0 commit comments