Skip to content

Commit

Permalink
chore: fix html code showing up in column picker & grid menu picker (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding authored May 13, 2023
1 parent 6891c36 commit f05f7a5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
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

0 comments on commit f05f7a5

Please sign in to comment.