js event on cdd rendered as checkbox not fired

OK, yeah, it works on initial page load (like when editing existing data), but the event isn't getting correctly removed and re-applied when the content is updated, i.e. when the watched element changes and the CDD display changes.

Working on it now.

-- hugh
 
I've installed the new fix and it's resolved the issue but now, when updating the cdd using js
Code:
Fabrik.getBlock('form_id').elements.get('table___element').update('')
the cdd isn't refreshed
 
OBTW, just so's you know ... not sure how we did it in 3.0, but in 3.1/2, if you are updating to anything other that "nothing" (empty string), it'll expect either an array, or a JSON representation of an array. And the value comparison is strict (===), so will need to be strings, like ...

Using JSON ...

Code:
Fabrik.getBlock('form_5').formElements.get('fab_cdd_test___city2').setValue('["1438", "1441"]')

... or using an array ...

Code:
var foo = ["1438", "1441"];
Fabrik.getBlock('form_5').formElements.get('fab_cdd_test___city2').setValue(foo);

Using an array of integers ...

Code:
var foo = [1438, 1441];

... wouldn't work.

-- hugh
 
are you sure the commit fixed the cascadingdropdown? because it seems the commit fixed databasejoin.js
 
ok great.
SO now, let's say we have a cdd #2 linked to another cdd #1. If I manually update the cdd #1 by using
Code:
setValue()
js's function, do the cdd #2 should automatically run an ajax update for its own value?
Or do I have to use a specific js function to run the ajax update? If yes, what is the function please?

In my case, the cdd #2 dosen't do the job when I call setValue()

Thanks
 
We only fire the elements 'change' event, to trigger any daisy chained CDD's, when it's actually running a change in response to the watched element being changed. The assumption is if you are setting values yourself, you probaby want to be in control of what is going on. So you need to fire that off yourself, with something like ...

Code:
yourcdd.element.fireEvent('change', new Event.Mock(yourcdd.element, 'change'));

... which will trigger the change code for anything watching it, i.e. should cause cdd #2 to do an AJAX call to the server and pick up it's new values. And 'youcdd' is your CDD object reference from the formElements.get().

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top