You are viewing limited content. For full access, please sign in.

Question

Question

Javascript to hide table column and field no longer working in Forms 10.3.1

asked on April 19, 2018

I have some JavaScript that hides a Table column and field that was working until I upgraded to Forms 10.3.1

// Hide Table Column
$(document).on("lookupcomplete", function(event) {
  $('table.tablehide thead th').eq(1).hide();
  $('table.tablehide thead th').eq(7).hide();
  $('table.tablehide thead th').eq(8).hide();
  $('table.tablehide tbody tr td.hidefield').hide();
});

This example hides column 1,7 and 8 and hides the fields with the hidefield set.

Any thoughts on why this no longer works in 10.3.1?

0 0

Replies

replied on April 19, 2018

Hi,

I just wanted to confirm whether you created the .tablehide and .hidefield classes by yourself. If so, did you add these classes in your CSS section? I've confirmed that the 'lookupcomplete' method is still available for 10.3.1 which means that it's probably your selectors that are causing problems. 

 

0 0
replied on April 19, 2018

Hello Kentaro,

Yes, I have the classes in the CSS section for the table and the fields being hidden. This was all working prior to upgrading from 10.3.0 to 10.3.1

I have even re-written the Javascript with different class names. 

I also re-created the table on my own VM using the same JavaScript and it still doesn't work.

Do I need to look at a way of rolling back to 10.3.0?

Is there another way to hide the columns and headers in a table?

0 0
replied on April 20, 2018

What I meant was this section. I don't see any syntax errors so it should be just a matter of fixing your selectors.

0 0
replied on April 20, 2018

In the CSS section as indicated in the image above, you probably need something like:

.tablehide, .hidefield{

display: none;

}

If that doesn't work, you can always do something like:

$('td[data-col="qx"]').hide(); // to hide column input fields

$('th#qx label').hide(); // to hide column header

Keep in mind that depends on your form. 

 

You might want to add an on click event for hiding newly added rows.

$('#idofaddbutton').on('click', function(){

// add hiding function here

};

 

 

 

0 0
replied on April 22, 2018

@████████

I found that  the JavaScript needs to be written slightly different. Originally, it was written like this...

// Hide Table Column
$(document).on("lookupcomplete", function(event) {
  $('table.tablehide thead th').eq(1).hide();
  $('table.tablehide thead th').eq(7).hide();
  $('table.tablehide thead th').eq(8).hide();
  $('table.tablehide tbody tr td.hidefield').hide();
});

But after changing it to this...

// Hide Table Column
$(document).on("lookupcomplete", function(event) {
  $('.tablehide table thead th').eq(1).hide();
  $('.tablehide table thead th').eq(7).hide();
  $('.tablehide table thead th').eq(8).hide();
  $('.tablehide table tbody tr td.hidefield').hide();
});

It now works (again).

 

0 0
replied on October 24, 2018

@████████ Is there a change in jQuery syntax on 10.3? If so, where can we find exactly what the changes are. I see that the version of jQuery being run on both 10.2 and 10.3 is 1.12.3. This makes me think the change resides with Laserfiche. 

Thanks

0 0
replied on October 24, 2018

There shouldn't be any syntax changes for jQuery; like you mentioned, they run on the same jQuery versions. However, there may be some minor HTML structural changes between the different product versions. I don't recall any documentation that lists these changes so you likely need to test and find out yourself. Usually, the changes are relatively minor so a quick inspection on the elements should give you enough information. I don't work at Laserfiche anymore but the presales team should be able to relay your question to the Forms development team and get back to you if you have any specific questions. 

1 0
replied on October 25, 2018 Show version history

Thanks Kentaro for the info.

We use MANY Forms throughout our organization, so the part where we need to test for ourselves can take several weeks to a month. I have identified an additional issue besides the one that @████████ mentioned above (thanks Jonathan!). It would make things a TON easier if Laserfiche could point out what those differences are and we could test them. Not doing so is an inadequacy of service imo. We have a TON of javascript on a TON of Forms Processes. As time goes on, there will only be more and more making this point seem even more unreasonable. I will be raising this subject with our VAR to voice our opinion. Thanks again for the clarification and best of luck with your new endeavors!

Chris

 

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.