Adding custom Javascript to simple modules + Advances modules in dashboard + account management
Hi there, I'm very happy with Fuel so far, but I'm kind of stuck right now with something.
I have a simple module on the dashboard which allows me to create members. One of the fields there is a select control in which the user type is chosen. I'd like to hide/display additional fields according to that choice using javascript, is it possible to load my custom javascript file with the module?
The other way I had thought about was doing it with an advanced module, but in that case how could I "embed" an advanced module into the dashboard?
Last question, is there a way to provide users the ability to access their account on the dashboard, something like Users for admin, but limited to their own account, so they can edit their email, password, etc. I understand this wouldn't be very difficult to achieve with a simple module but I figured it might already be there.
Thanks a lot,
Daniel.
Comments
The parameters are:
js_controller
js_controller_path
js_controller_params
js
Documentation for them can be found here:
http://www.getfuelcms.com/user_guide/modules/simple
In your case, unless you are wanting to use the jQX framework to do your javascript, you can just use the "js" parameter which can be a string or an array of javascript files to load using the js() function:
http://www.getfuelcms.com/user_guide/javascript/jqx
http://www.getfuelcms.com/user_guide/libraries/asset (js function)
With regards to a user being able to change their specific information, if they click on their name in the upper right, they should be able to change that information.
Thanks a lot.
js('file', ['module'], [params])
but I don't a way to add them (apart from file) through module config.
look inside your advanced module's config/modulename_fuel_modules.php file where you declare your modules' properties in the $config array for each module and add this will load the file.js inside fuel/modules/modelname/assets/js and make it available ONLY throughout module's views inside the backend (meaning the list/tree and form views)