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(demo): example with 3 plugins not sorting correctly #788

Merged
merged 1 commit into from
Jun 17, 2023
Merged
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
26 changes: 13 additions & 13 deletions examples/example-row-detail-selection-and-move.html
Original file line number Diff line number Diff line change
Expand Up @@ -248,18 +248,6 @@ <h3>Selected Titles:</h3>
checkboxSelectorPlugin = new Slick.CheckboxSelectColumn({ cssClass: "slick-cell-checkboxsel" });
columns.splice(columnIndex, 0, checkboxSelectorPlugin.getColumnDefinition());

grid = new Slick.Grid("#myGrid", dataView, columns, options);

// register the Selection Model that will be used for all Plugins
grid.setSelectionModel(new Slick.RowSelectionModel({
selectActiveRow: false,
dragToSelect: true
}));

// register all Plugins (Row Selection / Row Detail)
grid.registerPlugin(checkboxSelectorPlugin);
grid.registerPlugin(detailViewPlugin);

rowMovePlugin = new Slick.RowMoveManager({
cancelEditOnDrag: true,
singleRowMove: true,
Expand All @@ -274,11 +262,23 @@ <h3>Selected Titles:</h3>
return (dataContext.id % 2 === 1);
}
});
grid.registerPlugin(rowMovePlugin);

// use unshift to make it the 1st column OR splice to position it where you wish
columns.splice(1, 0, rowMovePlugin.getColumnDefinition());

grid = new Slick.Grid("#myGrid", dataView, columns, options);

// register the Selection Model that will be used for all Plugins
grid.setSelectionModel(new Slick.RowSelectionModel({
selectActiveRow: false,
dragToSelect: true
}));

// register all Plugins (Row Selection / Row Detail)
grid.registerPlugin(checkboxSelectorPlugin);
grid.registerPlugin(detailViewPlugin);
grid.registerPlugin(rowMovePlugin);

rowMovePlugin.onBeforeMoveRows.subscribe(function (e, args) {
// collapse any Row Details to avoid any rendering issues
detailViewPlugin.collapseAll();
Expand Down