Two Editors on one page

Two Editors on one page

komserbeykomserbey Posts: 25Questions: 0Answers: 0
edited March 2013 in Editor
Hello,

I have a page with three tabs. On the second and third page I have a DataTable with the Editor. On the second tab is fnAdjustColumnSizing () properly working. On the third tab fnAdjustColumnSizing () is not working, it will be called.

What should I do. Please help me :)

Regards,

K

Replies

  • allanallan Posts: 63,534Questions: 1Answers: 10,475 Site admin
    Can you link to a test case please? You note that it is working not he second tab, but not the third, and I'd need to see the code to understand why that might be happening.

    Allan
  • komserbeykomserbey Posts: 25Questions: 0Answers: 0
    Dear Allan,

    I send you a PM.

    Thank you.

    Regards,

    K
  • allanallan Posts: 63,534Questions: 1Answers: 10,475 Site admin
    Thank you for the PM.

    There is a Javascript error occurring on the page:

    > TypeError: 'undefined' is not an object (evaluating 'fieldConf.type')

    Which is caused by this line of code in your fnInitComplete callback:

    > editor.field('all_employee.id').update( json.all_employee );

    Its almost fine, but the variable should be `editorDriver` not `editor` - since that is what you set up further up the script.

    Regards,
    Allan
  • komserbeykomserbey Posts: 25Questions: 0Answers: 0
    Dear Allan,

    Thats really stupid of me :(
    Thank you!

    After corriging this, the header remain small in the third tab.
    Could you help please?

    Regards,

    K
  • allanallan Posts: 63,534Questions: 1Answers: 10,475 Site admin
    Try using this to resize the table rather than the current code in the 'activate' event handler you've got:

    [code]
    $.each( $.fn.dataTable.fnTables(true), function () {
    $(this).dataTable().fnAdjustColumnSizing();
    } );
    [/code]

    You've got two tables which where matching the selector and only the first was being resized. The above addresses that.

    Allan
  • komserbeykomserbey Posts: 25Questions: 0Answers: 0
    Dear Allan,

    Thank you!! Everything is fine now.

    Regards,

    K
This discussion has been closed.