neokoenig / jQuery-gridmanager

A way of building rows and grids with built in editable regions; requires jQuery, jQueryUI, Bootstrap 3.x, & optional TinyMCE or CKEditor
http://neokoenig.github.io/jQuery-gridmanager/
461 stars 129 forks source link

Re initiate editor after using appendHTMLSelectedCols #91

Closed nomi-ramzan closed 7 years ago

nomi-ramzan commented 8 years ago

I am using version 0.3.1 and I want to add some content using appendHTMLSelectedCols method. It is working fine. But I also wanted to edit that code after insertion. But I have to change go to preview then i can edit newly inserted code.

var gmElem = 
    $('.grid-manager').gridmanager({
        buttons: [[1,3,1,4,3], [2,8,2], [4,8], [8,4]]
    }).data('gridmanager');

Add function is here

function add() {
    gmElem.appendHTMLSelectedCols('<p>my content to append to all my selected cols</p>');
}

But I can not edit this p now until i will not view at lease one time preview.

nomi-ramzan commented 7 years ago

I got one way to do that gmElem.reset(); is there any better way to do that ?

neokoenig commented 7 years ago

yeah, reset will take existing HTML and reparse it, and then reinitialize the grid

nomi-ramzan commented 7 years ago

Thank you.