Target only one editor on page to make multicolumn

Target only one editor on page to make multicolumn

chris.cavagechris.cavage Posts: 46Questions: 12Answers: 0

I have a few editors on one page. When one table in particular opens to view/edit, I only want that specific one to be multicolumn.

I am using the css properties found here: https://editor.datatables.net/examples/styling/columns.html

The CSS, once I add it to my page, of div.DTE_Body div.DTE_Body_Content div.DTE_Field { } will affect ALL editors when they open.

How can I only have it apply to one particular editor used for a table with id = "multi_column" for example?

With this said, if this is possible, this one editor in particular needs to have a larger modal width too! I'm assuming I can adapt this solution to that as well.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Answer ✓

    The lightbox display controller is actually shared between all Editor instances on a page, so what you'd need to do is use open and close events to add suitable classes - e.g.:

    editor
      .on('open', function () {
        $('div.DTED_Lightbox_Content').addClass('multiColumn');
      })
      .on('close', function () {
        $('div.DTED_Lightbox_Content').removeClass('multiColumn');
      });
    

    Allan

  • chris.cavagechris.cavage Posts: 46Questions: 12Answers: 0

    Perfect. This worked. Thank you.

This discussion has been closed.