参数仅显示最后一列

I'm using coffe script to generate the javascript code for the datatables, like this:

class App.Empresas extends App.Base
inventarios: ->
$ ->
  $('#tabla_inventarios').dataTable
    ajax: $('#tabla_inventarios').data('source')
    columns: [
        data: "id_producto", 
    data: "nombre", 
    data: "categoria"
]

but the request using rails log shows this json:

 Parameters: {"draw"=>"1", "columns"=>{"0"=>{"data"=>"categoria", "name"=>"", "searchable"=>"true", "orderable"=>"false", "search"=>{"value"=>"", "regex"=>"false"}}}, "start"=>"0", "length"=>"10", "search"=>{"value"=>"", "regex"=>"false"}, "_"=>"1495682354559", "id"=>"85858-5"}

As you can see it only sends 1 column ("categoria") and it should send 3..

查看全部
weixin_33729196
weixin_33729196
2017/05/25 03:42
  • ruby-on-rails
  • datatables
  • ajax
  • 点赞
  • 收藏
  • 回答
    私信

1个回复