Carbon-fields: carbonFields.removeComplexFieldGroup never triggered!

Created on 30 Jul 2017  路  3Comments  路  Source: htmlburger/carbon-fields

Hey,

The JS API works like a charm, except 2 methods : removeComplexFieldGroup and addComplexFieldGroup.

Here is a very simple example, to illustrate :

(function($) { 

    $(document).on('carbonFields.apiLoaded', function(e, api) {

        console.log('fooooo!'); // Is triggered.

        $(document).on('carbonFields.removeComplexFieldGroup', function(e, fieldName, groupIndex) {
            console.log('babar'); // Doesn't work, never triggered :/
        });

        $(document).on('carbonFields.fieldUpdated', function(e, fieldName) {
            console.log('baaaar'); // Works fine !
        });

    });

})(jQuery);

Do you know why? Thanks a lot. Have a great day!

[type] question

All 3 comments

(and if you were wondering, I'm using complex fields of course : http://d.pr/i/yfbxYY).

Hi @kaleidoscopique ,

addComplexFieldGroup() and removeComplexFieldGroup() are utility methods of the API object - not events. Currently the API only provides the 'carbonFields.apiLoaded', 'carbonFields.fieldUpdated' and 'carbonFields.validateField' events.

(I added a note to our internal todo to list these events with a proper description in the docs)

Ups, okay ! It's clear for me now, thanks a lot.

Sorry to have bothered you. Have a great day Atanas! :1st_place_medal:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

broskees picture broskees  路  4Comments

leurdo picture leurdo  路  3Comments

olegburakov picture olegburakov  路  3Comments

Mick00 picture Mick00  路  3Comments

abdusfauzi picture abdusfauzi  路  3Comments