Last active
January 15, 2021 03:47
-
-
Save sbimochan/de293bd5477a04a78dd474b07c9d266f to your computer and use it in GitHub Desktop.
Open all rows of react-table in new tab. Change 7 to number of columns manually. You might get a pop up blocked in url box while running for first time.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getColumnIndices(total) { | |
let indices = []; | |
//7 because number of column is 7 | |
for (let index = 0; index < total; index += 7) { | |
indices.push(index); | |
} | |
return indices; | |
} | |
const allColumns = document.getElementsByClassName('rt-td'); | |
const indices = getColumnIndices(allColumns.length); | |
const rows = indices.map((index) => allColumns[index]); | |
const evt = new MouseEvent('click', { | |
view: window, | |
bubbles: true, | |
cancelable: true, | |
clientX: 20, | |
ctrlKey: true, | |
}); | |
rows.forEach((el) => el.dispatchEvent(evt)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment