keyTable overwrite/replace hidden tabIndex input

keyTable overwrite/replace hidden tabIndex input

JeyPJeyP Posts: 6Questions: 2Answers: 0

Description of problem:

Hello,

im trying to replace the default hidden "tabIndex" input that is rendered in the first td column.

(e=b('<div><input type="text" tabindex="'+e+'"/></div>').css({position:"absolute",height:1,width:0,overflow:"hidden"})

Is there a way to either replace this or change the input without touching the source code?

Thanks in adavance.
JeyP

Answers

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • JeyPJeyP Posts: 6Questions: 2Answers: 0

    Hey,

    sure, here is an example https://codepen.io/JeyP/pen/rNjjEQm

    You can find div in the first td of the first tbody tr.
    <div style="position: absolute; height: 1px; width: 0px; overflow: hidden;"><input type="text" tabindex="0"></div>

    The code i posted above is from the datatables.min.js

    Greetings
    JeyP

  • allanallan Posts: 61,667Questions: 1Answers: 10,096 Site admin

    Do you mean you just want to use a different value for the tablindex? If so, use keys.tabIndex.

    If it is something else you are looking for, could you clarify what that is for me please?

    Thanks,
    Allan

  • JeyPJeyP Posts: 6Questions: 2Answers: 0

    Hello,

    no, i want to change the element or better, add a class to that Element.
    My table is loaded dynamically and my page validates each new/changed element. I have added a class to my validation to skip certain elements but couldn't figure out, how to do it for the tabindex element.

    Is there some way, either during datatable creation or before, to add a class to that element or replace it completly with a custom one?

    Thanks
    JeyP

  • allanallan Posts: 61,667Questions: 1Answers: 10,096 Site admin

    Hi JeyP,

    Not really - you'd need to make a modification to this part of the code to customise that input element.

    Allan

This discussion has been closed.