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

Question

Question

modify laserfiche weblink8 ui

asked on March 6, 2014 Show version history

 Hi,

 

In our laserfiche weblink 8 ui we have two columns on the right side of the grid (see attached screenshot) called Return Date and Submittal Date.

 

We'd like to create a new column to the right of Submittal Date called Date Difference. The Date Difference column would represent the difference between the Return Date and Submittal Date values.

 

Can anyone point me to some documentation advising how to do that?

Is it possible through the UI or would we need some custom coding?

 

 

laserfiche_webclient.jpg
0 0

Answer

APPROVED ANSWER
replied on March 6, 2014

The folder browser is designed to get its contents from the Laserfiche server, so the easiest way to do that would be to have a field that contains the value you want.  Of course you would need an automated way of keeping it correct.

There aren't any integration points on the server to inject that data, but you could have some javascript in the browser update that table after page load.  It wouldn't be perfect since you wouldn't be able to sort on that column, but depending on your needs it could do what you want.

0 0

Replies

replied on April 23, 2014 Show version history

Whipped this up real quick to demonstrate how easily this could be done using JavaScript. The code has not been heavily tested. Open up "Browse.aspx" and right before the "</body>" tag paste the following code:

 

        <script language="javascript">
            var t = document.getElementsByClassName("DocumentBrowserDisplayTable");
            var h = t[0].tHead;
            var hr = document.createElement('th');
            hr.setAttribute('class','EntrySorterCell');
            hr.innerHTML = '<a href="return false;">Days</a>';
            h.rows[0].appendChild(hr);
            var b = t[0].tBodies[0];
            for (var i=0; i< b.rows.length; i++) {
                
                //First Date Value. Change cells[?] to match actual cell position of the first date
                var d1 = b.rows[i].cells[?].innerHTML;
                //Second Date Value. Change cells[?] to match actual cell position of the second date
                var d2 = b.rows[i].cells[?].innerHTML;

                //Calculate the days difference
                var d3 = days_between(d1,d2);

                //Add Difference Cell
                var c = b.rows[i].insertCell(-1);
                
                //Insert days difference value
                c.innerHTML = d3;
            }

            function days_between(date1, date2) {
                //http://www.mcfedries.com/javascript/daysbetween.asp
                // The number of milliseconds in one day
                var ONE_DAY = 1000 * 60 * 60 * 24

                // Convert both dates to milliseconds
                var date1_ms = date1.getTime()
                var date2_ms = date2.getTime()

                // Calculate the difference in milliseconds
                var difference_ms = Math.abs(date1_ms - date2_ms)
    
                // Convert back to days and return
                return Math.round(difference_ms/ONE_DAY)

            }

        </script>

Make sure you change the variables as noted in the code to reflect your actual table data. 

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

Sign in to reply to this post.