Table Editing with best_in_place in Ruby on Rails

Table Editing with best_in_place in Ruby on Rails

brunopgalvaobrunopgalvao Posts: 2Questions: 0Answers: 0
edited September 2013 in General
DataTables editing example (using best_in_place)

This example shows how to create editable tables using datatables.net and best_in_place in Ruby on Rails.

Currently Datatables.net only has example for using jediTables jQuery plugin.

Gemfile:
[code]gem "best_in_place"[/code]

app/assets/javascripts/application.js:
[code]
//= require jquery
//= require jquery-ui
//= require best_in_place
[/code]

app/views/schedules/index.html.haml:
[code]
%table
- @schedules.each do |s|
%tr
%td= best_in_place s, :name
:javascript
$(document).ready(function() {
/* Activating Best In Place */
jQuery(".best_in_place").best_in_place();
});
[/code]

Wiki: http://stackoverflow.com/questions/18597947/ruby-on-rails-best-in-place-datatables-net-haml

Replies

  • katlandrethkatlandreth Posts: 1Questions: 0Answers: 0
    Awesome! Thanks to this example I have Best_In_Place working correctly with my datatable. Thank you so much!

    I would love to integrate KeyTable with best_in_place in my datatable, but it's beyond me.

    There's a great example of integrating Jeditable with KeyTable here http://datatables.net/release-datatables/extras/KeyTable/editing.html , but I can't figure out how to make it work correctly with best_in_place instead of Jeditable.

    Basically, I've dropped the code from the above link into my site, and I've activated keytable correctly, but the return event isn't triggering cells to make them editable, and it's locking out the keying function. Hope that makes sense.

    I know there are probably lot perimeters from the jeditable example that should be changed to work with best_in_place instead of Jeditable, but I'm a noob and didn't know where to start.

    If you (or anyone) has any ideas as to how to make this work it would be very appreciated.
This discussion has been closed.