editor dependent field

editor dependent field

netliteITnetliteIT Posts: 6Questions: 1Answers: 0
edited June 19 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: 9,175Questions: 0Answers: 1,533

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

    Colin

  • netliteITnetliteIT Posts: 6Questions: 1Answers: 0

    Hi Colin perfect, solved!
    thanks a lot

Sign In or Register to comment.