Discussions

 View Only
  • 1.  Utilizing HTML/CSS pages in JS using IOL

    Posted 10-04-2018 14:45
    Good day everyone, 

    As a challenge, I've been provided by my company a standalone 'app' within QuickBase that has two tables ('States' table is the parent of 'Exchanges' table, as one state contains many exchanges), and the task at hand is to use JavaScript to create a column with buttons on the States table that:

    • Generates a pop-up form
    • The form should take in two pieces of info: Approval/Denial status and a Comment String
    •  That info is then used to make Quickbase API calls to update every exchange record for a given state 

    Pretty straightforward, right? 

    My issue is that I can't seem to get my JavaScript to communicate with my custom HTML/CSS code pages, so I can't get the pop-up window open. (Alerts, yes. Modals, no.)

    Typically, one starts with HTML and connects the JS via <script src=""></script> and the CSS via <link type="text/css" rel="stylesheet" href="">.  Launch the HTML page, utilize the DOM in JS, and there's no issue. 

    With QuickBase, I'm using the IOL technique, so my button is accessing JS first.  How do I get my JS code page to interact with my HTML/CSS code pages? Is there a trick with the 'document' object that I'm missing? 




    ----

    myButton variable: 

    <a href="javascript:void();" class="trinity-custom-button Vibrant" minwidth="Auto" maxwidth="Auto" fontsize="12" onclick ="generatePopUp(); return false;">Approval Review</a>

    <img src='/i/clear2x2.gif' onload="javascript:if(typeof QBU=='undefined'){QBU={};$.getScript(gReqAppDBID+'?a=dbpage&pagename=module.js&rand='+new Date().getTime())};">
    Appears like this, and can call functions from within my code page module.js:

    ">https://d2r1vs3d9006ap.cloudfront.net/s3_images/1754987/RackMultipart20181004-74487-dtkmyn-QuickBase_table_inline.PNG?1538664293">


  • 2.  RE: Utilizing HTML/CSS pages in JS using IOL

    Posted 10-04-2018 14:48
    Have you considered if there is a native approach using Automations?


  • 3.  RE: Utilizing HTML/CSS pages in JS using IOL

    Posted 10-04-2018 14:52
    Thanks for the quick response!
    I'm specifically being asked to provide a solution using JavaScript (even though there may be native solutions).