Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
6 changes: 4 additions & 2 deletions samples/grids/grid/column-pinning-both-sides/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,16 @@ export default function App() {

const pinLeft = () => {
gridRef.current?.selectedColumns().forEach((col: IgrColumn) => {
col.pinned = false;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could just use the api instead of changing the props. The column has pin method API.

col.pinningPosition = ColumnPinningPosition.Start;
col.pinned = true;
col.pinned = true;
});
};
const pinRight = () => {
gridRef.current?.selectedColumns().forEach((col: IgrColumn) => {
col.pinned = false;
col.pinningPosition = ColumnPinningPosition.End;
col.pinned = true;
col.pinned = true;
});
};
const unpinColumn = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export default function App() {
const grid = gridRef.current;
if (!grid) return;
grid.selectedColumns().forEach((col) => {
col.pinned = false;
col.pinningPosition = ColumnPinningPosition.Start;
col.pinned = true;
});
Expand All @@ -42,6 +43,7 @@ export default function App() {
const grid = gridRef.current;
if (!grid) return;
grid.selectedColumns().forEach((col) => {
col.pinned = false;
col.pinningPosition = ColumnPinningPosition.End;
col.pinned = true;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export default function App() {
const grid = gridRef.current;
if (!grid) return;
grid.selectedColumns().forEach((col) => {
col.pinned = false;
col.pinningPosition = ColumnPinningPosition.Start;
col.pinned = true;
});
Expand All @@ -41,6 +42,7 @@ export default function App() {
const grid = gridRef.current;
if (!grid) return;
grid.selectedColumns().forEach((col) => {
col.pinned = false;
col.pinningPosition = ColumnPinningPosition.End;
col.pinned = true;
});
Expand Down