-
Content Count
142 -
Joined
-
Last visited
-
Days Won
14
Hastur last won the day on May 21 2020
Hastur had the most liked content!
About Hastur
-
Rank
Advanced Member
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
Alison reacted to a post in a topic: Change color of the column in chart
-
Change color of the column in chart
Hastur replied to Alison's topic in User JavaScript and CSS Discussions
Hello! To change the color you need to use additional JS code. It will parse the data in chart and change the color according to name of the column. Here is the code: <script type="text/javascript"> document.addEventListener('DataPageReady', chartUpdateHandler); function chartUpdateHandler(event) { var cleaner = function(interv) { clearInterval(interv); } let interv = setInterval(() => { if (!!Highcharts) { const options = Highcharts.charts[0].series[0].data; let data = []; options.forEach(option => { let localData = {}; localData.y = op -
mhand reacted to an answer to a question: Create a record in a different table from a datapage
-
Vitalikssssss reacted to a post in a topic: How to get the file size
-
CoopperBackpack reacted to a post in a topic: How to get the file size
-
How to get the file size
Hastur replied to CoopperBackpack's topic in User JavaScript and CSS Discussions
Hello @CoopperBackpack You may use additional JS code to implement this workflow: <script type="text/javascript"> document.addEventListener('DataPageReady', fileInputEvent) function fileInputEvent() { document.querySelector("#InsertRecordFile_f"),addEventListener('change', fileInputHandler); // use the InsertRecord[your file field name] instead document.removeEventListener('DataPageReady', fileInputEvent) } function fileInputHandler(event) { const fileSizeInput = document.querySelector('#InsertRecordFile_size'); // use the InsertRecord[your file size field name] instead fi -
Vitalikssssss reacted to a post in a topic: Disable Submit button
-
Auto-submit a Form to Track User Page Views
Hastur replied to davidhshugar's question in General Questions
@davidhshugar I have improved the solution to work without reloading. You need to add one additional HTML block with this code: <p id="ancor"></p> The following code should be int the Header: <script type="text/javascript"> document.addEventListener('DataPageReady', submitHandler); function submitHandler() { let submissionForm = document.querySelector('form[action^="your_deploy_URL"]'); submissionForm.style.display = 'none'; if(document.getElementById('ancor') !== null) { document.removeEventListener('DataPageReady', submitHandler); -
iFrame scrolling options
Hastur replied to CoopperBackpack's topic in User JavaScript and CSS Discussions
Hello @CoopperBackpack You need to use some additional JS to handle the scroll This code needs to be inserted in the Header of the DataPage you open through the link: <script type="text/javascript"> document.addEventListener('DataPageReady', scrollHandler) function scrollHandler(event) { parent.postMessage('scrollHandler', '*'); document.removeEventListener('DataPageReady', scrollHandler) }; </script> This code needs to be placed in your CMS system before the deploy code of the DataPage: <script> window.addEventListener("message", receiveMessage, false -
CoopperBackpack reacted to a post in a topic: How to move placeholder to top on focus AND while typing
-
Hello @CoopperBackpack You can insert this snippet of code into your submission form Header: <style> .cbFormFieldCell { position: relative; width: 50%; } .cbFormFieldCell .floating-label { position: absolute; color: gray; font-size: 13px; pointer-events: none; top: 11px; left: 20px; transition: 0.2s ease all; } .cbFormFieldCell input:focus ~ .floating-label, .cbFormFieldCell input:not(:focus):valid ~ .floating-label { top: 0px; left: 10px; font-size: 10px; opacity: 1; background-color: white; padding: 0 3px; } </style> <script> document.addEventL
-
@GPJ11 Can you specify the DataPage element type and the Data Type of the field you use? You may send the print screens. It is critical to create the script
-
@benrob You an try the following: 1. Place this code outside of the iFrame deployment above the deploy code: <script type="text/javascript"> window.addEventListener("message", receiveMessage, false); function receiveMessage(event) { document.querySelector('iframe[name="Search and Report"]').height = event.data } </script> 2. Insert this code into the Result set of the Report: Header: </header> <div id="wrapper"> <header> Footer: </footer> </div> <footer> <script type="text/javascript"> document.addEve
-
Alert Box For When Specific Value is Chosen
Hastur replied to kpcollier's topic in User JavaScript and CSS Discussions
Hello @kpcollier You can use this code: <script type="text/javascript"> document.addEventListener('DataPageReady', assignAdditionalListeners) function assignAdditionalListeners() { document.querySelector('input[id^="InsertRecordtext_f0"]').addEventListener('change', customAlert); // change ID document.querySelector('input[id^="InsertRecordtext_f1"]').addEventListener('change', customAlert); // change ID document.querySelector('input[id^="InsertRecordtext_f2"]').addEventListener('change', customAlert); // change ID document.querySelector('input[id^="InsertRecordtext_f3"]'). -
@benrob You may use this code in the Result set of the Report: 1. Header - </header> <div id="wrapper"> <header> 2. Footer - </footer> </div> <footer> <script type="text/javascript"> document.addEventListener('DataPageReady', resizeHandler) function resizeHandler(event) { let heightVal = document.getElementById('wrapper').offsetHeight + 150; // Change 150 according to the height of the search form var localWindow = window.parent.document.querySelector('iframe[name="Search and Report"]').style; // Change the name of the DataPa
-
Display aggregate of total time as HH:MM
Hastur replied to guardmetrics's question in Calculations and aggregations
@guardmetrics You may use this formula: CAST((( DATEDIFF(minute, [@field:Patrol_Activity_Database_Date], [@field:Patrol_Activity_Database_1_Date]) - (DATEDIFF(minute, [@field:Patrol_Activity_Database_Date], [@field:Patrol_Activity_Database_1_Date]) % 60) ) / 60) AS nvarchar) + ':' + CASE WHEN LEN(CAST((DATEDIFF(minute, [@field:Patrol_Activity_Database_Date], [@field:Patrol_Activity_Database_1_Date]) % 60) AS nvarchar)) = 1 THEN '0' + CAST((DATEDIFF(minute, [@field:Patrol_Activity_Database_Date], [@field:Patrol_Activity_Database_1_Date]) % 60) AS nvarchar) ELSE CAST((DATEDIF- 4 replies
-
- aggregate
- totals aggregation groups
- (and 6 more)
-
crionsynx reacted to an answer to a question: Format of TimeStamp Date Changes After Exporting (mm/dd/yyyy to m/d/yyy)
-
Format of TimeStamp Date Changes After Exporting (mm/dd/yyyy to m/d/yyy)
Hastur replied to crionsynx's question in Import/Export and DataHub
Hello @crionsynx You may use additional formula field to get needed layout. Here is the example: CONVERT(nvarchar, [@field:asdwasd], 101) + ' ' + CONVERT(nvarchar, [@field:asdwasd], 108) -
guardmetrics reacted to an answer to a question: Display aggregate of total time as HH:MM
-
Hello @Jaymee Try to insert this code in the header of the DataPage result set <script type="text/javascript"> document.addEventListener('DataPageReady', hideBlankHandler) function hideBlankHandler() { let labels = document.querySelectorAll('.cbResultSetListViewDataLabel '); let values = document.querySelectorAll('.cbResultSetData'); console.log(labels , values) for (let i = 0; i < values.length; i++) { if (values[i].innerHTML === " ") { labels[i].remove(); values[i].remove(); } } } </script> You need to check two thing. First - your
-
Hello @KevinCeres You can achieve this using standard features. You can add the Virtual field to your form with 2 option: stay at form after submission or go next. The values of these radio buttons should be links. Based on the choice, your user will be redirected to the same page (reload) or to a new one. Check the print screens:
-
Display aggregate of total time as HH:MM
Hastur replied to guardmetrics's question in Calculations and aggregations
@guardmetrics The calculated field should look like this in: CAST((( DATEDIFF(minute, [@field:Patrol_Activity_Database_Date], [@field:Patrol_Activity_Database_1_Date]) - (DATEDIFF(minute, [@field:Patrol_Activity_Database_Date], [@field:Patrol_Activity_Database_1_Date]) % 60) ) / 60) AS nvarchar) + ':' + CAST((DATEDIFF(minute, [@field:Patrol_Activity_Database_Date], [@field:Patrol_Activity_Database_1_Date]) % 60) AS nvarchar) Also you may find other examples here -- 4 replies
-
- aggregate
- totals aggregation groups
- (and 6 more)