Editor in a modal popup

Editor in a modal popup

ts9117ts9117 Posts: 4Questions: 0Answers: 0
edited September 2013 in Editor
Hi there,
We recently purchased a license and are attempting to switch from using purely jeditable with datatables, to now using the editor extension. We'd like to be able to attach an 'envelope' type interaction when editing/adding to our table; however, we're having some difficulties doing so.
Our situation is a little odd because we're working with a mix of legacy aspx and mvc3. We render our modal from a string of html. I think because either a) we're trying to do this in a modal or b) the way we render our modal, when we get to the "_findAttachRow" method self._dte.s.domTable is not set.

[code]

var envelopeConf = $.fn.dataTable.Editor.display.envelope.conf;
envelopeConf.attach = 'head';
envelopeConf.windowScroll = false;

editor = new $.fn.dataTable.Editor({
"domTable": "#sortable-datatable.summary-grid",
"display": "envelope",
"fields": [{
"label": "Contents:",
"name": "Contents",
"type": "textarea"
}]
});
[/code]

Replies

  • ts9117ts9117 Posts: 4Questions: 0Answers: 0
    http://debug.datatables.net/ayukan
  • allanallan Posts: 61,805Questions: 1Answers: 10,119 Site admin
    I'm slightly confused by the content of your question relative to the title. Are you trying to put the Editor form into a modal popup? If so, you wouldn't use the envelope display controller, but rather create one which is suitable for whatever modal library it is that you are using: http://editor.datatables.net/tutorials/display_controllers

    Allan
  • ts9117ts9117 Posts: 4Questions: 0Answers: 0
    Hi Allan,

    Sorry to be confusing. Our datatable is contained within a modal. We'd like to add the envelope effect on that table. We bind our datatable on the document ready to the fully formatted table on the page and that works just fine. However we are unable to bind the Editor to the same table using the "domTable" attribute.

    I hope that makes sense, I'm not 100% familiar with the terminology here.
    The workflow is: Open modal -> bind datatable to dom table -> bind editor to same dom table.
    We want the envelope to attach to the already open modal.
  • ts9117ts9117 Posts: 4Questions: 0Answers: 0
    Hi Allan,

    An update for you.
    I've fixed the situation, turns out that it was an issue with the order of our scripts.

    However, there is something else that I came upon when using the "Envelope" container.

    the section in the envelope display is as follows.

    //event handlers
    $(self._dom.close).unbind( 'click.DTED_Lightbox' );
    $(self._dom.background).unbind( 'click.DTED_Lightbox' );
    $('div.DTED_Lightbox_Content_Wrapper', self._dom.wrapper).unbind( 'click.DTED_Lightbox' );

    Not sure if this what mean to be an out-of-box feature or if it has been updated. But thought I would note that there are some collisions with the naming that cause errors for multiple cancels without any submits inbetween.
This discussion has been closed.