jbox-web / ajax-datatables-rails

A wrapper around DataTable's ajax methods that allow synchronization with server-side pagination in a Rails app
MIT License
586 stars 228 forks source link

Add "order nulls last" option #242

Closed natebird closed 6 years ago

natebird commented 7 years ago
natebird commented 7 years ago

I'm open to also creating a per column option. But I'm unsure where that would go and how to pass it to the SimpleOrder class. Any ideas would be helpful. Thanks!

ajahongir commented 7 years ago

well, you have to add method a public into column.rb

def nulls_last
  @view_column.fetch(:nulls_last, true)
end

and then you can access from SimpleOrder as column.nulls_last

natebird commented 7 years ago

@ajahongir I'm running into an issue in the test where I can't call column because the datatable doesn't have the column_by method. Can you help me understand why that isn't available? It seems to be only a testing issue.

ajahongir commented 7 years ago

where is your test falling?

natebird commented 7 years ago

It's failing in the simple_order_spec. But it traces back to simple_order.rb where I'm calling column.nulls_last https://github.com/jbox-web/ajax-datatables-rails/pull/242/files#diff-4f1e2d7f5a934d960a24dbd4ab6929e4R25. column blows up because it can't return a value because the column_by method doesn't exist for the @datatable.

natebird commented 7 years ago

So, I got things worked out. But the build is failing on the Oracle tests. I don't think it is related to my changes. What do I need to do to get them passing?

natebird commented 7 years ago

Also, does this need readme documentation? I'm happy to add that to this PR if you want it.

natebird commented 6 years ago

Any ideas on how to get the Oracle tests passing?

natebird commented 6 years ago

What can I do to get this Oracle test passing?

n-rodriguez commented 6 years ago

@natebird the Oracle tests now pass, can you please rebase?

natebird commented 6 years ago

Yep. I’ll do it later tonight. Thanks!

n-rodriguez commented 6 years ago

be careful there's a lot of changes :/

natebird commented 6 years ago

Closing in favor of the cleaner, #279 PR. I couldn't do a clean rebase so I just recreated the branch. :-)