5098 Posts in 1518 Topics by 1115 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1253 Views |
-
Include a custom field's javascript in a model admin instance

30 June 2010 at 1:54am
Hey guys,
I've possibly confused myself here, but I'd love some help.
I've created a couple custom form field types for a website, and these are being included both in a page type and in a model admin instance. It works just fine in the page type situation, but when it comes to the model admin, it doesn't include the javascript it requires. Is there a reason for this, or a step I'm missing?
Cheers in advance
-
Re: Include a custom field's javascript in a model admin instance

29 September 2011 at 3:32am
Hey,
how can i add JavaScript to a custom Field in ModelAdmin / SilverStripe?
-
Re: Include a custom field's javascript in a model admin instance

29 September 2011 at 10:21am
^^ try this:
class YourAdmin extends ModelAdmin {
...
public function init() {
parent::init();Requirements::javascript('mysite/javascript/yourjavascript.js');
}
...
}Cheers
| 1253 Views | ||
|
Page:
1
|
Go to Top |


