Hide Field display while loading form

Hello @community,
I write some code to hide fields in my form and it works fine.
Also, i write code to change title of fields as per users language.
Same thing i doing in child form. (New/Edit form that open by list or library new and Edit button).
My problem is while i open form, at initial time while form is loading, i can see that fields also text did not change at that time.

The same thing happen for list or library control, I use CAML query to filter list or library control, and at initial time while form is loading it showing all sensitive data without filtering.

How can i overcome this issue?
Can i increase load time of form?, if yes than How?

Thanks in advance.

1 Like

Hello @harshp924,

You can create a separate form set for each language and route user based on language settings.

Another option is to remove titles from the form and fill it dynamically on form load.

Regarding filtering data in List or Library control, you can hide control on form load and show it only after filtration is applied using the code:

fd.rendered(function() {
    $('.data-table').hide();
});

fd.spRendered(function() {
    fd.field('Title').title = 'test';

    var dt = fd.control('SPDataTable1');
    dt.ready().then(function() {
        filterDT()
});
    function filterDT(){
        dt.filter = "<Eq><FieldRef Name='Title'/><Value Type='Text'>Default value</Value></Eq>";
        dt.refresh();
        setTimeout(function(){ $('.data-table').show(); }, 1000);
    }
});

Where data-table is the CSS class given to parent grid cell.
image

1 Like