Jump to content

Vitalikssssss

Caspio Rockstar
  • Content Count

    497
  • Joined

  • Last visited

  • Days Won

    49

Reputation Activity

  1. Thanks
    Vitalikssssss reacted to Alison in Hide Columns on Tabular Report When Empty   
    Hi @bbeshlian ,

    Here is a snippet of JavaScript and JQuery code to hide columns if they are empty:
     
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script> document.addEventListener('DataPageReady', function(e) { let $table = $('.cbResultSetTable:first'); let tbody = $table[0].tBodies[0]; let colsLen = tbody.rows[0].cells.length, rowsLen = tbody.rows.length; let hideNode = function(node) { if (node) node.style.display = "none"; }; for (var j = 0; j < colsLen; ++j) { let counter = 0; for (var i = 1; i < rowsLen; ++i) { if (tbody.rows[i].cells[j].textContent.trim() == '') ++counter; } if (counter == (rowsLen - 1)) { for (var i = 1; i < rowsLen; ++i) { hideNode(tbody.rows[i].cells[j]); } hideNode(tbody.rows[0].cells[j]); } } }); </script> You should put the code above into the Footer element on the Search and Report Wizard - Configure Results Page Fields.
  2. Like
    Vitalikssssss got a reaction from dmyoungsal in Trouble creating Join   
    Hi @dmyoungsal,
    I think you will be able to resolve this case by creating a one-to-many relationship.
    https://www.youtube.com/watch?v=IstAk982ntA
    You can create a self-join View if your table have a one-to-many relationship.
    https://howto.caspio.com/tables-and-views/what-are-views/self-join-views/
    Hope this helps.
    Regards,
    vitalikssssss
  3. Like
    Vitalikssssss got a reaction from roattw in Top and bottom scrollbar on report data page?   
    Hi @roattw,
    You can implement the solution from this topic .
    1. Disable AJAX loading of Datapage;
    2. Place the following code into Datapage Header:
    <style> .wrapper1, .wrapper2 { width: 100%; overflow-x: scroll; overflow-y: hidden; } .wrapper1 { height: 20px; } .wrapper2 {} .div1 { height: 20px; } .div2 { overflow: none; } </style> <script src="https://code.jquery.com/jquery-1.9.1.js"></script> <div class="wrapper1"> <div class="div1"></div> </div> <div class="wrapper2"> <div class="div2"> 3. Place the following code in Datapage Footer:
    </div> </div> <script> $(function () { $('.wrapper1').on('scroll', function (e) { $('.wrapper2').scrollLeft($('.wrapper1').scrollLeft()); }); $('.wrapper2').on('scroll', function (e) { $('.wrapper1').scrollLeft($('.wrapper2').scrollLeft()); }); }); $(window).on('load', function (e) { $('.div1').width($('table').width()); $('.div2').width($('table').width()); }); </script> Make sure that you disable HTML editor otherwise it breaks the code in the Header.
    Hope this helps.
    Regards,
    vitalikssssss
  4. Like
    Vitalikssssss got a reaction from kpcollier in Top and bottom scrollbar on report data page?   
    Hi @roattw,
    You can implement the solution from this topic .
    1. Disable AJAX loading of Datapage;
    2. Place the following code into Datapage Header:
    <style> .wrapper1, .wrapper2 { width: 100%; overflow-x: scroll; overflow-y: hidden; } .wrapper1 { height: 20px; } .wrapper2 {} .div1 { height: 20px; } .div2 { overflow: none; } </style> <script src="https://code.jquery.com/jquery-1.9.1.js"></script> <div class="wrapper1"> <div class="div1"></div> </div> <div class="wrapper2"> <div class="div2"> 3. Place the following code in Datapage Footer:
    </div> </div> <script> $(function () { $('.wrapper1').on('scroll', function (e) { $('.wrapper2').scrollLeft($('.wrapper1').scrollLeft()); }); $('.wrapper2').on('scroll', function (e) { $('.wrapper1').scrollLeft($('.wrapper2').scrollLeft()); }); }); $(window).on('load', function (e) { $('.div1').width($('table').width()); $('.div2').width($('table').width()); }); </script> Make sure that you disable HTML editor otherwise it breaks the code in the Header.
    Hope this helps.
    Regards,
    vitalikssssss
  5. Like
    Vitalikssssss got a reaction from JaredL in Graph manipulation with (Java) script   
    Hi @Berti,
    I can say that Caspio uses HighChart library to render the chart. 
    I don`t have a solution for your described case but perhaps you can try to use a solution from this topic:
    Stackoverflow
    Regards,
    vitalikssssss
  6. Like
    Vitalikssssss got a reaction from abitaquest in JS Date Restrictions Quit Working   
    Hi @edujobs2k18,
    You may try to use the following Javascript solution:  
    <script type="text/javascript"> document.addEventListener('BeforeFormSubmit', function(event) { var entered_value = document.getElementById("InsertRecordDate0").value; var entered_date = new Date(entered_value); var permitted_date = new Date(); permitted_date.setDate(permitted_date.getDate()); if(entered_date < permitted_date) { alert("Cannot be a date in the past"); return false; } }); </script> This solution is designed for Submission form with AJAX enabled. Also, field name "Date0" used from your post.
    Hope this helps.
     
    Regards,
    vitalikssssss
  7. Like
    Vitalikssssss got a reaction from Heineperson in Replace document.write with innerHTML   
    Hi @Heineperson,
    Sorry, I forgot to add inner HTML in my code. Please try to use the following code:
    <div id='record[@cbRecordIndex#]'></div> <script type="text/javascript"> document.addEventListener('DataPageReady', function (event) { if ("[@field:tblRareTaxonTable_ProfileStatus]" == "Active") { document.getElementById("record[@cbRecordIndex#]").innerHTML="<div style='background:#A0CE4E;border:1px solid #000000;padding:5px 10px;'><span style='font-size:16px;'><strong><a href='https://saveplants.org/national-collection/plant-search/plant-profile/?CPCNum=[@field:tblRareTaxonTable_CPCNumber]' <span style='color:#482441;'>Go To Profile</span></a></strong></span></div>"; } else { document.getElementById("record[@cbRecordIndex#]").innerHTML="<div style='background:#482441;border:1px solid #000000;padding:5px 10px;'><span style='font-size:16px;'><span style='color:#FFFFFF;'><strong>Profile In Progress</strong></span></span></div>"; } }); </script> Regards,
    vitalikssssss
  8. Thanks
    Vitalikssssss got a reaction from Heineperson in Replace document.write with innerHTML   
    Hi @Heineperson,
    You can try following code with inner HTML:
    <div id='record[@cbRecordIndex#]'></div> <script type="text/javascript"> debugger; document.addEventListener('DataPageReady', function (event) { if ("[@field:tblRareTaxonTable_ProfileStatus]" == "Active") { document.write("<div style='background:#A0CE4E;border:1px solid #000000;padding:5px 10px;'><span style='font-size:16px;'><strong><a href='https://saveplants.org/national-collection/plant-search/plant-profile/?CPCNum=[@field:tblRareTaxonTable_CPCNumber]' <span style='color:#482441;'>Go To Profile</span></a></strong></span></div>"); } else { document.write("<div style='background:#482441;border:1px solid #000000;padding:5px 10px;'><span style='font-size:16px;'><span style='color:#FFFFFF;'><strong>Profile In Progress</strong></span></span></div>"); } }); </script> Hope this helps.
    Regards,
    vitalikssssss
  9. Thanks
    Vitalikssssss got a reaction from hstange in CASE in calculated field   
    Hello nuimage,
    Please note that  @calcfield2 will have value after page load as per your described workflow, hence.
    I would suggest having two Datapages (Report&Single record update form) to replicate your workflow.
    On your Report Datapage you can place a link in HTML block to Single record update form and pass @calcfield2 value as a query string.
    Parameters-as-query-string-values
    Hope this helps.
  10. Thanks
    Vitalikssssss reacted to AndrewCHughes in PHP Caspio REST API library   
    This may be of use to people. This is pulled out of a project I'm working on. It's a PHP library that manages the low-level integration with the Caspio REST API. If I have time I'll pull more classes out of the project that might be helpful and integrate them into this library. But it demonstrates the basics of interacting with the Caspio REST API via PHP.
    https://github.com/moksamedia/caspio-rest-api-lib
  11. Like
    Vitalikssssss got a reaction from hstange in Add Date to String in Formula   
    Hi DesiLogi,
    You can convert date/time field to a String with the following expression:
     
    LEFT(CONVERT(VARCHAR, [@field:Date], 120), 10)
     
    Regards,
    vitalikssssss
  12. Like
    Vitalikssssss got a reaction from AussieCaspio in System Date in View?   
    Hi @AussieCaspio,
    You can create a View which will filter your table with promotion based on start and end date. 
    Here is an example of filter:

    This article might be useful:  
    https://howto.caspio.com/tables-and-views/what-are-views/creating-a-view-to-filter-data/
    Regards,
    vitalikssssss
  13. Thanks
    Vitalikssssss got a reaction from MHDslagelse in Week number   
    Hi MHDslagelse,
    Please note that Datepart(week) function is not supported in Formula field because it is non- deterministic. 
    You may use the workaround described in this post .
    Regards,
    vitalikssssss
  14. Thanks
    Vitalikssssss got a reaction from bookish in Triggered action Update for bulk edit   
    Hi bookish,
    Please note that bulk edit is treated as a single update event in Triggered Action as you have already discovered.
    I would suggest using COUNT expression in order to count the number of records updated with a bulk edit and add this value to existing value from  SCHEDULES table.
    So, you Triggered Action will look similar to this one:

    Hope this helps.
     
     
  15. Like
    Vitalikssssss got a reaction from ChristineM in One to Many Data Pages html block for details page   
    Hi ChristineM,
    I suppose that you have forgotten to press "Source" button in HTML editor before inserting the code.
    The issue described in this article: https://howto.caspio.com/faq/caspio-bridge-8-4/inserting-code-in-html-blocks-and-header-footer/
    Regards,
    Vitalikssssss
  16. Like
    Vitalikssssss got a reaction from vikovs in Embed Within A Datapage, A Pdf Stored On Caspio Database   
    Hi everyone,
    I have revised the initial Javascript solution so it could meet the requirements of recent Asynchronous deployment method which do not support window.onload() event.
    <iframe id="iframe_pdf" style="width:80%; height: 1100px; display: none;" align="middle" frameborder="0"></iframe> <script> document.addEventListener('DataPageReady', function (event){ if(!("[@field:Document/]" == "")){ embed_pdf(); } }); function embed_pdf(){ var google_link= "https://docs.google.com/gview?url="; var google_param = "&embedded=true"; var pdf_link = "[@field:Document/]"; var encoded_pdf_link = encodeURIComponent(pdf_link); var iframe_window = document.getElementById("iframe_pdf"); iframe_window.style.display = "block"; iframe_window.src=google_link + encoded_pdf_link + google_param; } </script>  
  17. Thanks
    Vitalikssssss got a reaction from Corey in Custom Details Page Link   
    Hi Corey,
    You can use a method described in this tutorial article:
    https://howto.caspio.com/tech-tips-and-articles/tech-parameters/results-and-details-on-two-separate-web-pages/
    Hope this helps.
    Regards,
    vitalikssssss
  18. Thanks
    Vitalikssssss got a reaction from cgonzalezalcala in Table Autoscroll   
    Hi cgonzalezalcala,
     
    I have been able to make this solution work in my Datapage. 
    You should do following steps:
    1. Datapage Header
    Insert following code:
    <script src="//code.jquery.com/jquery-1.11.3.min.js"></script> <div id="contain"> <style> #contain { height: 100px; overflow-y: scroll; } #table_scroll { width: 100%; margin-top: 100px; margin-bottom: 100px; border-collapse: collapse; } #table_scroll thead th { padding: 10px; background-color: #ea922c; color: #fff; } #table_scroll tbody td { padding: 10px; background-color: #ed3a86; color: #fff; } </style> 2. Datapage Footer
    Insert following code:
    </div> <script> var my_time; $(document).ready(function() { pageScroll(); $("#contain").mouseover(function() { clearTimeout(my_time); }).mouseout(function() { pageScroll(); }); }); function pageScroll() { var objDiv = document.getElementById("contain"); objDiv.scrollTop = objDiv.scrollTop + 1; $('p:nth-of-type(1)').html('scrollTop : '+ objDiv.scrollTop); $('p:nth-of-type(2)').html('scrollHeight : ' + objDiv.scrollHeight); if (objDiv.scrollTop == (objDiv.scrollHeight - 100)) { objDiv.scrollTop = 0; } my_time = setTimeout('pageScroll()', 25); } </script> This should do the trick.
     
    Cheers,
    vitalikssssss
  19. Thanks
    Vitalikssssss got a reaction from lmooring in Date+1 and Insert on Submission Form   
    Hi Imooring,
    You can try to use the following code on your Submission Form in order to insert "+1 day" value into your Expire Date field upon user select the date in End Date field:
    <script> function DateAdd() { var a = new Date(document.getElementById('InsertRecordYOUR_FIELD_End_Date').value); a.setDate(a.getDate() + 1); var dd = a.getDate(); var mm = a.getMonth()+1; var yy= a.getFullYear(); var b = mm + '/' + dd + '/'+yy; // you should change an order if you use non-US localization in your Submission Form document.getElementById('InsertRecordYOUR_FIELD_Expiration_Date').value=b; } document.getElementById('InsertRecord_YOUR_FIELD_End_Date').onchange= DateAdd; </script> You should place this code into the Footer of your Submission Form. Please make sure that you have disabled HTML editor.
    Hope this helps.
     
  20. Thanks
    Vitalikssssss got a reaction from MyNameIsSean in Triggered Actions on Timestamp field   
    Hi MyNameIsSean,
    It looks like the issue has been fixed.
    I have been able to create a Trigger which inserts the Timestamp value from parent table into Date&Time field.
     
    Regards,
    vitalikssssss
  21. Thanks
    Vitalikssssss got a reaction from MyNameIsSean in Triggered Actions on Timestamp field   
    Hi MyNameIsSean,
     
    That is very odd behavior which I believe will be resolved in an upcoming Caspio Bridge release.
    In the interim, you can try to build the Triggered action as per below as a temporary workaround.
    Hope this helps.

  22. Thanks
    Vitalikssssss got a reaction from Accountability in Concatenating Virtual Fields Cascading Drop Downs   
    Hi Accountability,
    I have noticed a syntax error in your code where you trying to reference Cascading Elements.
    Here is an example of the correct syntax for referencing Cascading Elements:
     Hope this helps.
  23. Thanks
    Vitalikssssss got a reaction from roattw in Hiding Multiple Login Forms: cb-auth-box Anyone succeed with this?   
    Hello roattw,
    You should disable Caspio HTML editor in order to avoid this issue.
    Hope this helps.
  24. Thanks
    Vitalikssssss reacted to alexm72 in No File Chosen   
    See my post similar to this where you can create your own button or make the opacity 0
  25. Like
    Vitalikssssss got a reaction from mark048 in Combine Virtual Fields into another Virtual Field   
    Hi Mark,
    I believe that it is possbile. You may customize JS solution from this post:
    https://forums.caspio.com/index.php?/topic/3200-js-concatenatecombine-two-fields-into-one-field/
    You need to change element_id to reference Virtual field(correct syntax:  cbParamVirtualX ).
    You may also need to change an event  trigger  i.o. onsubmit.
    Hope this helps.
     
×
×
  • Create New...