[ckan-dev] wanted: js module / form snippet to dynamically add/remove fields

Brook Elgie brook.elgie at okfn.org
Fri Jan 29 09:10:51 UTC 2016


Hi Harald,

Yes! We did exactly this with ckanext-repeating and the author field.

Here's the relevant JS and template:

https://github.com/okfn/ckanext-lcrnz/blob/master/ckanext/lcrnz/templates/package/snippets/package_metadata_fields.html

https://github.com/okfn/ckanext-lcrnz/blob/master/ckanext/lcrnz/fanstatic/lcrnz-repeating.js

Good luck!

Brook

On 28 January 2016 at 19:33, Harald von Waldow <harald.vonwaldow at eawag.ch>
wrote:

> Hi,
>
> I wonder whether someone has some code that would add "remove" and "new"
> buttons to a form-field so that the user can dynamically choose for
> example how many "authors" she wants. Basically pimping up
> ckanext-repeating.
>
> Thanks,
> Harald
>
>
> --
> Harald von Waldow
> Eawag
> ICT Services
> Ueberlandstrasse 133
> 8600 Duebendorf
> http://www.eawag.ch
>
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20160129/be1f9559/attachment-0003.html>


More information about the ckan-dev mailing list