Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Customising the CMS /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Fire jquery after ajax load in admin panel [SOLVED]

Go to End

2 Posts   1068 Views


Community Member, 12 Posts

27 February 2014 at 2:18pm

Edited: 27/02/2014 4:47pm


I have been struggling with this for a while now.

I have some dropdowns in the admin panel for a set of data objects that I want to change dynamically. They are for a car selection e.g. Make > Model > Year > Series.

I can access the data for each dropdown using the live function like this:

$( "select#Form_ItemEditForm_MakeID" ).live( "change", function() {
alert( "This works!" );

But this only runs when the dropdown is changed. This will be useful when I want to change the other dropdowns but how can I can store the dropdown's options data using Jquery once the ajax load is complete? I can get it to work once if I do a hard refresh of the page but if I navigate using the admin panel tabs the page is loaded via ajax.

Can anyone point me in the right direction?



Community Member, 12 Posts

27 February 2014 at 4:47pm

I found it. I just needed to use the onmatch selector.

onmatch: function(e){
console.log("This works");

If you know of a better way I am happy to hear it.