Comments (1)
Here is a possible solution i came up with :
In nestable_helper.rb
module RailsAdmin
module NestableHelper
RailsAdmin::ApplicationHelper.class_eval do
def menu_for(parent, abstract_model = nil, object = nil, only_icon = false) # perf matters here (no action view trickery)
actions = actions(parent, abstract_model, object).select { |a| a.http_methods.include?(:get) }
actions.collect do |action|
wording = wording_for(:menu, action)
%(
<li title="#{wording if only_icon}" rel="#{'tooltip' if only_icon}" class="icon #{action.key}_#{parent}_link #{'active' if current_action?(action)}">
<a class="#{action.pjax? ? 'pjax' : ''}" href="#{url_for(action: action.action_name, controller: 'rails_admin/main', model_name: abstract_model.try(:to_param), id: (object.try(:persisted?) && object.try(:id) || nil), query: (action.key == :nestable) ? params[:query] : nil)}">
<i class="#{action.link_icon}"></i>
<span#{only_icon ? " style='display:none'" : ''}>#{wording}</span>
</a>
</li>
)
end.join.html_safe
end
end
end
end
This little snippet allows you to pass along the query param in the url to the orderable list view. Then, you could just use the built in rails_admin filter to scope your list and order the filtered results.
I was thinking about doing a merge request about this. Tell me what you guys think.
from rails_admin_nestable.
Related Issues (20)
- "undefined method `options' for nil:NilClass" when using nestable_list HOT 1
- wrong number of arguments (1 for 3) when update HOT 3
- nestable_tree true is required
- Sorting a tree
- How to display associated model's name in sorting menu HOT 2
- Corrupt gemfile
- scope does not work as expected
- Any chance to replace default "list" with a "nestable_tree"? HOT 5
- Gradient has outdated direction syntax
- Possibility to sort children of a parent (Has many association) HOT 6
- nestable list not nestable HOT 3
- Gets stuck in loop HOT 1
- `render text: msg` is deprecated in Rails 5.1 HOT 1
- NoMethodError in RailsAdmin::Main#nestable HOT 1
- Bundle outdated HOT 1
- jquery.nestable typo
- Render collapsed tree HOT 1
- ActionView::Template::Error on Rails 6 HOT 3
- Compatible with Rails 7.0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rails_admin_nestable.