Merge pull request #143 from shariquerik/add-tooltip-on-filter

This commit is contained in:
Shariq Ansari 2022-01-29 11:27:32 +05:30 committed by GitHub
commit a278075247
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -328,7 +328,8 @@ export default class RowManager {
if (props.isFilter) {
row = row.map(cell => (Object.assign({}, cell, {
content: this.getFilterInput({
colIndex: cell.colIndex
colIndex: cell.colIndex,
name: cell.name
}),
isFilter: 1,
isHeader: undefined,
@ -350,8 +351,10 @@ export default class RowManager {
}
getFilterInput(props) {
let title = `title="Filter based on ${props.name || 'Index'}"`;
const dataAttr = makeDataAttributeString(props);
return `<input class="dt-filter dt-input" type="text" ${dataAttr} tabindex="1" />`;
return `<input class="dt-filter dt-input" type="text" ${dataAttr} tabindex="1"
${props.colIndex === 0 ? 'disabled' : title} />`;
}
selector(rowIndex) {