Library control JS filter stopped working

Hi *
I experience that JS controlled filtering of content in library control has stopped working.
This has been running fine for some time, but now no filter is applied - and all list content is displayed in control.

Here is a sample f the code used:

// ************ Filter on Child list "Ansatte" *****************************
var dt1 = fd.control('Ansatte');
dt1.ready().then(function() {
    filterDT1();
});

function filterDT1(){
    // Field in Child list
       dt1.filter = "<Eq><FieldRef Name='EnhetsNavn'/><Value Type='Text'>"
        + fd.field('Title').value + "</Value></Eq>";
    dt1.refresh();
}

Forms app is ver 1.0.8.1
Please advise.
Thanks

Dear @geirmat,
Seems to work fine for me, of course, wrapped inside fd.spRendered() - please, check console for errors, and post a screenshot of any errors here. Also, you can try to remove the rest of the code from the form for now, and just test this part:

fd.spRendered(function(){
    var dt1 = fd.control('Ansatte');
    dt1.ready().then(function() {
        filterDT1();
    });

    function filterDT1(){
        // Field in Child list
        dt1.filter = "<Eq><FieldRef Name='EnhetsNavn'/><Value Type='Text'>"
         + fd.field('Title').value + "</Value></Eq>";
        dt1.refresh();
    }
});

Thanks! Got it working again. Proved to be an error elsewhere in the JS.

1 Like