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 #10

Open
wants to merge 5 commits into
base: 23.1.3+
Choose a base branch
from
Open
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 @@ export class AppComponent implements AfterViewChecked {

validateVisibleRows(): void {
const dataGridInstance = this?.dataGrid?.instance;
const currentChanges = (dataGridInstance?.option('editing.changes') as DxDataGridTypes.DataChange[])
.filter((c) => Object.keys(c.data).length > 0);
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 @@ function App(): JSX.Element {

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);
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 dataGridRef = ref<DxDataGrid>();

const validateVisibleRows = () => {
const dataGridInstance = dataGridRef.value?.instance! as dxDataGrid;
const currentChanges = (dataGridInstance?.option('editing.changes') as DxDataGridTypes.DataChange[])
.filter((c) => Object.keys(c.data).length > 0);
const fakeChanges = dataGridInstance
? dataGridInstance
.getVisibleRows()
Expand All @@ -76,7 +78,7 @@ const validateVisibleRows = () => {
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);
const fakeChanges = grid.getVisibleRows().map((row) => ({ type: 'update', key: row.key, data: {} }));

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