editor dependent field

editor dependent field

netliteITnetliteIT Posts: 6Questions: 1Answers: 0
edited June 2020 in DataTables 1.10

I,i'm refer to editor, i notice that my dependent fields alwasy show this indicator

<div data-dte-e="field-processing" class="DTE_Processing_Indicator" style="display: block;"><span></span></div> 

It is correct?

Here my code

editor.dependent( 'born_date', function ( val ) {
                        editor.field('age').val(calculate_age(val));
} );

// with external function to calculate age from  born_date

function calculate_age(data) {
var parts =data.split('-');
console.log(parts[2]+ parts[1] + parts[0]);
var dob = new Date(parts[2], parts[1] - 1, parts[0]);
    var diff_ms = Date.now() - dob.getTime();
    var age_dt = new Date(diff_ms);

    return Math.abs(age_dt.getUTCFullYear() - 1970);
}

Follow the images

Thanks

Replies

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Try adding callback(true) at the end - see example here,

    Colin

  • netliteITnetliteIT Posts: 6Questions: 1Answers: 0

    Hi Colin perfect, solved!
    thanks a lot

This discussion has been closed.