blocknotes / activeadmin_dynamic_fields Goto Github PK
View Code? Open in Web Editor NEWActiveAdmin plugin to add dynamic behaviors to fields
License: MIT License
ActiveAdmin plugin to add dynamic behaviors to fields
License: MIT License
Does this gem work for a rails 7 importmaps implementation? I have implemented according to the non-webpacker guide.
I have installed it and am getting the following error
active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3773 jQuery.Deferred exception: Cannot read properties of undefined (reading 'substr') TypeError: Cannot read properties of undefined (reading 'substr')
at dfSetupField (http://localhost:3000/assets/activeadmin/dynamic_fields-b1e8a0a3194d41b3af16532e01aecf823d396b7bf4d1b7eb747c9fb002429230.js:65:18)
at HTMLInputElement.<anonymous> (http://localhost:3000/assets/active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:54591:5)
at Function.each (http://localhost:3000/assets/active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:383:19)
at jQuery.fn.init.each (http://localhost:3000/assets/active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:205:17)
at HTMLDocument.<anonymous> (http://localhost:3000/assets/active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:54590:142)
at mightThrow (http://localhost:3000/assets/active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3479:29)
at process (http://localhost:3000/assets/active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3547:12) undefined
jQuery.Deferred.exceptionHook @ active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3773
process @ active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3551
setTimeout (async)
(anonymous) @ active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3592
fire @ active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3213
fireWith @ active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3343
fire @ active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3351
fire @ active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3213
fireWith @ active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3343
ready @ active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3834
completed @ active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3844
active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3773 jQuery.Deferred exception: Cannot read properties of undefined (reading 'substr') TypeError: Cannot read properties of undefined (reading 'substr')
at dfSetupField (http://localhost:3000/assets/activeadmin/dynamic_fields-b1e8a0a3194d41b3af16532e01aecf823d396b7bf4d1b7eb747c9fb002429230.js:65:18)
at HTMLInputElement.<anonymous> (http://localhost:3000/assets/activeadmin/dynamic_fields-b1e8a0a3194d41b3af16532e01aecf823d396b7bf4d1b7eb747c9fb002429230.js:162:5)
at Function.each (http://localhost:3000/assets/active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:383:19)
at jQuery.fn.init.each (http://localhost:3000/assets/active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:205:17)
at HTMLDocument.<anonymous> (http://localhost:3000/assets/activeadmin/dynamic_fields-b1e8a0a3194d41b3af16532e01aecf823d396b7bf4d1b7eb747c9fb002429230.js:161:142)
at mightThrow (http://localhost:3000/assets/active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3479:29)
at process (http://localhost:3000/assets/active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3547:12) undefined
jQuery.Deferred.exceptionHook @ active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3773
process @ active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3551
setTimeout (async)
(anonymous) @ active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3592
fire @ active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3213
fireWith @ active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3343
fire @ active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3351
fire @ active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3213
fireWith @ active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3343
ready @ active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3834
completed @ active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3844
active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3783 Uncaught TypeError: Cannot read properties of undefined (reading 'substr')
at dfSetupField (dynamic_fields-b1e8a0a3194d41b3af16532e01aecf823d396b7bf4d1b7eb747c9fb002429230.js:65:18)
at HTMLInputElement.<anonymous> (active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:54591:5)
at Function.each (active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:383:19)
at jQuery.fn.init.each (active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:205:17)
at HTMLDocument.<anonymous> (active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:54590:142)
at mightThrow (active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3479:29)
at process (active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3547:12)
dfSetupField @ dynamic_fields-b1e8a0a3194d41b3af16532e01aecf823d396b7bf4d1b7eb747c9fb002429230.js:65
(anonymous) @ active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:54591
each @ active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:383
each @ active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:205
(anonymous) @ active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:54590
mightThrow @ active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3479
process @ active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3547
setTimeout (async)
jQuery.readyException @ active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3782
(anonymous) @ active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3802
mightThrow @ active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3479
process @ active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3547
setTimeout (async)
(anonymous) @ active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3592
fire @ active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3213
fireWith @ active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3343
fire @ active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3351
fire @ active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3213
fireWith @ active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3343
process @ active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3567
setTimeout (async)
(anonymous) @ active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3592
fire @ active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3213
fireWith @ active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3343
fire @ active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3351
fire @ active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3213
fireWith @ active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3343
ready @ active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3834
completed @ active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3844
active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3783 Uncaught TypeError: Cannot read properties of undefined (reading 'substr')
at dfSetupField (dynamic_fields-b1e8a0a3194d41b3af16532e01aecf823d396b7bf4d1b7eb747c9fb002429230.js:65:18)
at HTMLInputElement.<anonymous> (dynamic_fields-b1e8a0a3194d41b3af16532e01aecf823d396b7bf4d1b7eb747c9fb002429230.js:162:5)
at Function.each (active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:383:19)
at jQuery.fn.init.each (active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:205:17)
at HTMLDocument.<anonymous> (dynamic_fields-b1e8a0a3194d41b3af16532e01aecf823d396b7bf4d1b7eb747c9fb002429230.js:161:142)
at mightThrow (active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3479:29)
at process (active_admin-d81fcd50ea26a294816d55dd8fa3a3840381fbaa776b65a6b242d3eec2610558.js:3547:12)
If I want to add a feature or correction and I whant to run test before a pull request. how can I do?
Hello,
Thanks for this wonderful gem that we really needed.
Our need was basic
So we used this:
f.has_many :steps,
allow_destroy: true,
heading: false,
new_record: true,
do |step|
step.input :field1,
input_html: { data: { if: 'blank', action: 'hide', target: '.st_video_related' } }
step.input :field2,
wrapper_html: { class: 'st_video_related' }
step.input :field3,
wrapper_html: { class: 'st_video_related' }
step.input :field4,
wrapper_html: { class: 'st_video_related' }
We thought that when you say if = blank, then the targets will be hidden. But the outcome was the opposite we had expected. Field 2, 3 and 4 were
viewable when the field 1 was empty and
not viewable when the field 1 was filled
So we changed to the opposite: step.input :field1,
input_html: { data: { if: 'not_blank', action: 'hide', target: '.st_video_related' } }
and now it works: all Steps where field 1 is empty have field 2,3 and 4 invisible
Did we misunderstand how the semantic works or is there something weird here? shouldn't we really put : input_html: { data: { if: 'blank', action: 'hide', target: '.st_video_related' } } ?
Thanks
Hello.
I am using the following library.
https://github.com/platanus/activeadmin_addons
When using select2, activeadmin_dynamic_fields does not work.
I know it is difficult to be compatible with other 3rd party libraries, but it would be nice to be supported.
Thank you.
Hi!
I see this example for hide fields, if checkbox is set.
f.input :published, input_html: { data: { if: 'checked', action: 'hide', target: '.grp1' } }
But I need make a toggle set of fields depend checkbox: after toggle checkbox a few fields will show, and few is hide. Can I make this with activeadmin_dynamic_fields?
I noticed the commit which introduced support for activeadmin 2.x, but if my understanding is correct, then the referenced condition on the gemspec file still locks activeadmin to 1.x.
Is there any plan to support the new version of AA?
One event that is according to use really important and frequent and missing is change.
We have checked and blank/not_blank.
What about the cases where a user has an active amdin field filled, then change the content of this field. If it is dynamic, it could also trigger something. Could we have an event 'change' ?
Regards,
Michael
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.