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

chore: fix html code showing up in column picker & grid menu picker #768

Merged
merged 1 commit into from
May 13, 2023
Merged
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
6 changes: 3 additions & 3 deletions controls/slick.columnpicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@

const labelElm = document.createElement('label');
labelElm.htmlFor = `${_gridUid}colpicker-${columnId}`;
labelElm.textContent = columnLabel;
labelElm.innerHTML = columnLabel;
liElm.appendChild(labelElm);
_listElm.appendChild(liElm);
}
Expand Down Expand Up @@ -243,8 +243,8 @@

/** Update the Titles of each sections (command, customTitle, ...) */
function updateAllTitles(gridMenuOptions) {
if (_columnTitleElm && _columnTitleElm.textContent) {
_columnTitleElm.textContent = gridMenuOptions.columnTitle;
if (_columnTitleElm && _columnTitleElm.innerHTML) {
_columnTitleElm.innerHTML = gridMenuOptions.columnTitle;
}
}

Expand Down
16 changes: 8 additions & 8 deletions controls/slick.gridmenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@
if (_options.gridMenu && _options.gridMenu.customTitle) {
_customTitleElm = document.createElement('div');
_customTitleElm.className = 'title';
_customTitleElm.textContent = _options.gridMenu.customTitle;
_customTitleElm.innerHTML = _options.gridMenu.customTitle;
customMenuElm.appendChild(_customTitleElm);
}

Expand Down Expand Up @@ -365,7 +365,7 @@

const textElm = document.createElement('span');
textElm.className = 'slick-gridmenu-content';
textElm.textContent = item.title;
textElm.innerHTML = item.title;

liElm.appendChild(textElm);

Expand All @@ -390,7 +390,7 @@
if (_options.gridMenu && _options.gridMenu.columnTitle) {
_columnTitleElm = document.createElement('div');
_columnTitleElm.className = 'title';
_columnTitleElm.textContent = _options.gridMenu.columnTitle;
_columnTitleElm.innerHTML = _options.gridMenu.columnTitle;
_menuElm.appendChild(_columnTitleElm);
}

Expand Down Expand Up @@ -468,7 +468,7 @@

const labelElm = document.createElement('label');
labelElm.htmlFor = `${_gridUid}-gridmenu-colpicker-${columnId}`;
labelElm.textContent = columnLabel;
labelElm.innerHTML = columnLabel;
liElm.appendChild(labelElm);
_listElm.appendChild(liElm);
}
Expand Down Expand Up @@ -627,11 +627,11 @@

/** Update the Titles of each sections (command, customTitle, ...) */
function updateAllTitles(gridMenuOptions) {
if (_customTitleElm && _customTitleElm.textContent) {
_customTitleElm.textContent = gridMenuOptions.customTitle;
if (_customTitleElm && _customTitleElm.innerHTML) {
_customTitleElm.innerHTML = gridMenuOptions.customTitle;
}
if (_columnTitleElm && _columnTitleElm.textContent) {
_columnTitleElm.textContent = gridMenuOptions.columnTitle;
if (_columnTitleElm && _columnTitleElm.innerHTML) {
_columnTitleElm.innerHTML = gridMenuOptions.columnTitle;
}
}

Expand Down
3 changes: 3 additions & 0 deletions examples/example-checkbox-row-select.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<link rel="stylesheet" href="../slick.grid.css" type="text/css"/>
<link rel="stylesheet" href="examples.css" type="text/css"/>
<link rel="stylesheet" href="../controls/slick.columnpicker.css" type="text/css"/>
<link rel="stylesheet" href="../controls/slick.gridmenu.css" type="text/css"/>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" crossorigin="anonymous">
<style>
.slick-cell-checkboxsel {
Expand Down Expand Up @@ -84,6 +85,7 @@ <h2>View Source:</h2>
<script src="../plugins/slick.cellselectionmodel.js"></script>
<script src="../plugins/slick.rowselectionmodel.js"></script>
<script src="../controls/slick.columnpicker.js"></script>
<script src="../controls/slick.gridmenu.js"></script>
<script src="../slick.formatters.js"></script>
<script src="../slick.editors.js"></script>
<script src="../slick.grid.js"></script>
Expand Down Expand Up @@ -148,6 +150,7 @@ <h2>View Source:</h2>
grid2.registerPlugin(checkboxSelector2);

var columnpicker = new Slick.Controls.ColumnPicker(columns, grid, options);
var gridMenuControl = new Slick.Controls.GridMenu(columns, grid, options);

grid.onSelectedRowsChanged.subscribe(function (e, args) {
// debugging to see the active row in response to questions
Expand Down