Does the inline editor work with DataTables?

Does the inline editor work with DataTables?

nmoschkinnmoschkin Posts: 7Questions: 1Answers: 0
edited September 2016 in DataTables 1.10

I want to write a completely custom editor using the inline editor method but I want to tie it to DataTables... I've looked at the examples, and the only place it seems where you have inline editing is with the editor functioning as a stand-alone editor.

Is it possible to make an inline editor for datatables, and what about mutli-row editing?

To clarify, I want to be able to position and group edit elements into various sections, some of them in scrollable content areas, and some of them in fixed content areas, within a single complex edit form, but I want to use the editor's built-in type-handling and rendering functionality, and I want to be able to show this in a jQueryUI popup window, and I want it to be tied to the currently selected row or rows of the associated DataTable.

Answers

  • nmoschkinnmoschkin Posts: 7Questions: 1Answers: 0

    To clarify, I want to be able to position and group edit elements into various sections, some of them in scrollable content areas, and some of them in fixed content areas, within a single complex edit form, but I want to use the editor's built-in type-handling and rendering functionality, and I want to be able to show this in a jQueryUI popup window, and I want it to be tied to the currently selected row or rows of the associated DataTable.

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

    Hi,

    Could you clarify what you mean by a completely custom editor, with Editor? Do you want to use Editor and create a custom field type?

    Editor's inline editing ability is limited to a single field at a time at the moment. There is no way to use it to do multi-line or multi-field editing.

    Allan

  • nmoschkinnmoschkin Posts: 7Questions: 1Answers: 0

    Well ... what I mean is ... I want to be able to display a popup/lightbox and have it divided into sections with data arranged in a specific way.

    I was thinking that if I were to use inline editing of some kind, I could just edit the fields individually ... but arranged in a specific way ... off of a DataTable.

  • nmoschkinnmoschkin Posts: 7Questions: 1Answers: 0

    I suppose I could use the inline stand-alone editor ...

    ... then before the call I would populate the fields with the data from the selected rows, and somehow let the server know which rows those are ... then I could edit and save, and all the changes that go back to the server would be applied to the selected rows ...

    If there's a plugin framework for this sort of thing, let me know ... because I'm out of options, and out of time, and I will just write the dang thing, myself. LOL ... I'm quite a bundle of nerves, right now ... a huge client wants these changes and we do not want to disappoint.

  • nmoschkinnmoschkin Posts: 7Questions: 1Answers: 0

    Okay. Well, oddly enough, I got it to work, and it's everything I'd ever hoped except one really big drawback. I cannot tab between the fields. Even if I set them as tab-stops, they just revert to not-tab-stops once I edit one field.

    No matter ... diving into the code, I've learned that doing it this way, I might as well just do it the other way ... custom data fields, manual AJAX processing ... and webshims.

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

    Thanks for the updates - good to hear you've got it working as you want!

    Allan

  • nmoschkinnmoschkin Posts: 7Questions: 1Answers: 0

    I did ... I took DataTables apart ... and put it back together again.

    Once I figured out how the AJAX transactions work (there is no documentation on the stand-alone transactions, btw, it's incomplete ... I had to investigate with error_log() calls) ... I knew exactly what I needed to do.

    I have the editor designed, now ... there's a section that always stays on top, for demographic data, and then there's a section beneath that is scrollable, for other data that needs to be filled out. ... I created a system to automatically generate the HTML for the table from the list of fields ... for user access control purposes ... not all users can see all and do all ... so I had to get creative.

    I do have a couple of other questions.

    You know how the table flashes and stays in position after the Editor is invoked? Can I get it to do that when I edit the table with my custom editor? Right now I just update the row, redraw the table and scroll back to the row I was working with ... would like to make it a bit polished.

    Also ... I noticed that the default CSS for when you have the scroller plugin enabled, every other row does not highlight all the way across when pressed ... wondering if you could quickly tell me where to change that.

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

    You know how the table flashes and stays in position after the Editor is invoked? Can I get it to do that when I edit the table with my custom editor?

    You'd need a bit of custom code to do that. There isn't a public API that Editor presents for that. Basically it adds a class that does a CSS transition and then uses a setTimeout to remove it a short time later and transitions back.

    I noticed that the default CSS for when you have the scroller plugin enabled, every other row does not highlight all the way across when pressed ...

    Can you give me a jsbin or jsfiddle link to a page showing that issue please. I'm not aware of that issue with Scroller.

    Allan

  • nmoschkinnmoschkin Posts: 7Questions: 1Answers: 0

    You still have access to the system, you can log in and see for yourself the issue....

This discussion has been closed.