5099 Posts in 1519 Topics by 1116 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 231 Views |
-
How do I refresh a form field in the CMS after saving?

17 January 2013 at 1:11am Last edited: 17 January 2013 1:47am
I've created a custom field which I'm trying to use in the CMS, but I can't get it to render correctly after saving a page.
When it initially loads, I use Requirements::javascript() calls to include my required files. This works, but when the form refreshes after a save, the field loses its styles.
Is there a way I can style the fields (execute my js) after the form refreshes?
I've read the javascript documentation here but i can't seem to find a solution.
Any help would be greatly appreciated.
-
Re: How do I refresh a form field in the CMS after saving?

17 January 2013 at 9:30am
If you are not already you might like to use entwine for your javascript. Also, iirc, I had some problems with styles being applied after AJAX load of pages in ModelAdmin (SS3.0.2 I think) - simply because when the page was being retrieved via AJAX the HTML markup changed very slightly (missed a wrapping div I think).
-
Re: How do I refresh a form field in the CMS after saving?

1 February 2013 at 12:29am
Thanks for the reply.
I was struggling with how to do it with entwine.
For anybody with the same issue, the solution was:
jQuery(document).ready(function($)
{
$(SELECTOR).entwine({
onmatch: function ()
{
// load form field...
}
});
});
| 231 Views | ||
|
Page:
1
|
Go to Top |


