Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sample #9

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ASP.NET Core/Views/Home/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<script>
function validateVisibleRows() {
const grid = $("#gridContainer").dxDataGrid("instance");
const currentChanges = grid.option("editing.changes");
const currentChanges = grid.option('editing.changes').filter(c => Object.keys(c.data).length > 0);
const fakeChanges = grid.getVisibleRows().map(function (row) {
return { type: "update", key: row.data.ID, data: {} };
});
Expand Down
4 changes: 3 additions & 1 deletion Angular/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@

validateVisibleRows(): void {
const dataGridInstance = this?.dataGrid?.instance;
const currentChanges = (dataGridInstance?.option('editing.changes') as DxDataGridTypes.DataChange[])
.filter((c) => Object.keys(c.data).length > 0);

Check failure on line 31 in Angular/src/app/app.component.ts

View workflow job for this annotation

GitHub Actions / Angular

Expected indentation of 6 spaces but found 4
const fakeChanges = dataGridInstance
? dataGridInstance.getVisibleRows().map((row: DxDataGridTypes.Row): DxDataGridTypes.DataChange => ({ type: 'update', key: row.key, data: {} }))
: [];
this.changes = [...this.changes, ...fakeChanges];
this.changes = [...currentChanges, ...fakeChanges];
this.checked = true;
}

Expand Down
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @DevExpressExampleBot
4 changes: 3 additions & 1 deletion React/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@

const validateVisibleRows = React.useCallback(() => {
let dataGrid = grid?.current?.instance;
const currentChanges = (dataGrid?.option('editing.changes') as DataGridTypes.DataChange[])
.filter((c) => Object.keys(c.data).length > 0);

Check failure on line 21 in React/src/App.tsx

View workflow job for this annotation

GitHub Actions / React

Expected indentation of 6 spaces but found 4

Check failure on line 21 in React/src/App.tsx

View workflow job for this annotation

GitHub Actions / React

Expected indentation of 6 spaces but found 4
const fakeChanges = dataGrid
? dataGrid.getVisibleRows().map((row: DataGridTypes.Row): DataGridTypes.DataChange => ({ type: 'update', key: row.key, data: {} }))
: [];
// alternatively, you can use the DataGrid|option method to set a new changes array
setChanges([...changes, ...fakeChanges]);
setChanges([...currentChanges, ...fakeChanges]);
setClicked(true);
}, [changes]);

Expand Down
4 changes: 3 additions & 1 deletion Vue/src/components/HomeContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@

const validateVisibleRows = () => {
const dataGridInstance = dataGridRef.value?.instance! as dxDataGrid;
const currentChanges = (dataGrid?.option('editing.changes') as DataGridTypes.DataChange[])

Check failure on line 70 in Vue/src/components/HomeContent.vue

View workflow job for this annotation

GitHub Actions / Vue

'dataGrid' is not defined

Check failure on line 70 in Vue/src/components/HomeContent.vue

View workflow job for this annotation

GitHub Actions / Vue

'DataGridTypes' is not defined
.filter((c) => Object.keys(c.data).length > 0);
const fakeChanges = dataGridInstance
? dataGridInstance
.getVisibleRows()
Expand All @@ -76,7 +78,7 @@
data: {}
}))
: [];
changes.value = [...changes.value, ...fakeChanges];
changes.value = [...currentChanges, ...fakeChanges];
clicked.value = true;
};

Expand Down
2 changes: 1 addition & 1 deletion jQuery/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

function validateVisibleRows() {
const grid = $('#gridContainer').dxDataGrid('instance');
const currentChanges = grid.option('editing.changes');
const currentChanges = grid.option('editing.changes').filter(c => Object.keys(c.data).length > 0);

Check failure on line 46 in jQuery/src/index.js

View workflow job for this annotation

GitHub Actions / jQuery

Expected parentheses around arrow function argument
const fakeChanges = grid.getVisibleRows().map((row) => ({ type: 'update', key: row.key, data: {} }));

grid.option('editing.changes', [...currentChanges, ...fakeChanges]);
Expand Down
Loading