Obtain the editor instance (When have multiple editors)

Obtain the editor instance (When have multiple editors)

yairneeyairnee Posts: 4Questions: 1Answers: 0

Hello world,
For auto tests i am trying to access editor fields in a UI.
I am trying to do it by getting the editor instance.
DataTable().editor() help me only to get the last editor instance, but i am looking for previous instances also.
how i can obtain previous instances?

Thank you, Yair.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin

    You'd need to keep a list of the instances externally. As the editor() documentation notes:

    The Editor instance used by this method is the last Editor instance create that refers to this table when the table was constructed. This consideration is only important when using multiple Editor instances.

    There is no API method to get multiple Editor instances for a table.

    Allan

  • yairneeyairnee Posts: 4Questions: 1Answers: 0

    Thank you for your answer Allan.
    There is anyway to access elements via DataTable and not by tags and class names?
    And without changing the DataTable.

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin

    What do you mean by "elements"? rows().nodes() will give you the tr elements in the table.

    Allan

  • yairneeyairnee Posts: 4Questions: 1Answers: 0

    Thank you for your answer.
    I am new on this so so sorry in advance if i don't use the correct names.
    For example i am looking for one of the form error.
    One way to get it is to do search by class "DTE_Form_Error".
    I wondered if there is anyway to do it by using the datatable only.
    (for example, i got a button text by using ().DataTable().buttons()[0].node )

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin
    Answer ✓

    No - there isn't an API method to get the error node in an Editor form. You can set an error message using error(), but if you want to access the element directly you would need to use jQuery and a suitable selector. The documentation for the Editor DOM structure is available here.

    Allan

  • yairneeyairnee Posts: 4Questions: 1Answers: 0

    Thank you very much for all your help Allan.

This discussion has been closed.