fix: Adding tooltip on filter inputs

This commit is contained in:
Shariq Ansari 2021-09-28 13:43:59 +05:30
parent cb2729424b
commit 88a361f053

View File

@ -325,7 +325,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,
@ -347,8 +348,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) {