Bootstrap DataTable with native Editor

Bootstrap DataTable with native Editor

errorkneeserrorknees Posts: 10Questions: 0Answers: 0
edited June 2013 in General
Is this possible? I've managed to implement a Bootstrap-styled DataTable that filters/sorts/pages on the server-side via a Web Service. Now I'm trying to implement the Editor but I don't want the Bootstrap one that slides down from the top - I just want the native one.

I'm trying to debug why the rows won't select to make the Edit/Delete buttons active but I've had no luck. It seems that the CSS classes added to the rows after a click are different for Bootstrap vs native.

Any help will be greatly appreciated.

(I know it's been said before but thanks for such an awesome plugin. And I couldn't believe that the creator responds to almost every forum post. This is not just flattery so that I get help :)

Edit: this could probably be in the "Editor" sub-forum
Edit2: i can't find what removes the class 'DTTT_disabled' from the buttons, or what adds the class 'active' to the rows

Replies

  • errorkneeserrorknees Posts: 10Questions: 0Answers: 0
    Does one have to manually attach a row click event handler and then populate the editing form with that row's values? I thought that functionality was out the box. The Editor examples makes it seem so.
  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    There is this line of code in the Editor Bootstrap integration file:

    > $.fn.dataTable.Editor.defaults.display = "bootstrap";

    Just remove that and it will use the Editor "lightbox" control instead. The line just sets the display controller to be the Bootstrap display controller plug-in by default.

    Another option is to set the `display` option during the initialisation of Editor and set it to "lightbox".

    Allan
  • errorkneeserrorknees Posts: 10Questions: 0Answers: 0
    That line is in 'dataTables.editor.bootstrap.js' which I haven't even included - I included 'dataTables.editor.min.js' only. My problem is that the rows are not selecting when I click them. I'm still debugging to find out why. Do you have any other suggestions?
  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    > Now I'm trying to implement the Editor but I don't want the Bootstrap one that slides down from the top - I just want the native one.

    This was the line I based my previous comment on. If you aren't using the Editor bootstrap integration file, then how are you using the Bootstrap modal?

    > My problem is that the rows are not selecting when I click them. I'm still debugging to find out why. Do you have any other suggestions?

    TableTools is what adds the `active` class (again that comes from the Bootstrap integration - in this case the `active` class comes from: https://github.com/DataTables/Plugins/blob/master/integration/bootstrap/dataTables.bootstrap.js#L134 .

    Do you have a page you can link to so I can take a look and see what is going wrong?

    Thanks,
    Allan
  • errorkneeserrorknees Posts: 10Questions: 0Answers: 0
    edited June 2013
    Thanks Allan..

    I've decided to move CRUD stuff to separate pages for now but I'll probably use/buy the Editor soon for something and set up a test page for debugging..
This discussion has been closed.