Jump to content

aam82

Caspio Guru
  • Posts

    190
  • Joined

  • Last visited

  • Days Won

    10

Everything posted by aam82

  1. If that is your only issue, then this little edit should do it: Go to Styles-Caspian(or whatever stylesheet that datapage uses) -ResultsPage, Paging -scroll down to Element Type: Paging Controls Cell and click it -click ... next to alignment, and set to middle-left instead However, this is an issue with Divi Builder, or the settings you have specified there. Your datapages are too wide for the divs, and the overflow is visible. You could also try limiting your column widths on the LEFT datapage, so that the total page width is less, to try to make it actually fit the div. You will also run into issues with monitors/resolutions that are different than your own. Right now you are correcting for your particular setup only.
  2. I use this script in a footer to find email addresses in a report, put them in a box (semi-colon separated), and copy the contents of the box to a clipboard on button click. It should work if you only have emails in one column, and want all of them. <p id="emailCount"></p> <textarea id="emailOutput" style="width: 500px; height: 200px;"></textarea> <p> <button class="js-textareacopybtn">Copy Emails to clipboard</button> </p> <SCRIPT LANGUAGE="JavaScript"> var elems = document.getElementsByTagName("td"); var copiedEmails = []; var numEmails = 0; for (var i=0, m=elems.length; i<m; i++) { if (elems[i].innerText.includes("@")) { copiedEmails.push(elems[i].innerText); numEmails += 1; console.log (numEmails); } } var joinedEmails = copiedEmails.join("; "); document.getElementById("emailOutput").innerHTML= joinedEmails; document.getElementById("emailCount").innerHTML= "Found " + numEmails + " emails."; </script> <script> var copyTextareaBtn = document.querySelector('.js-textareacopybtn'); copyTextareaBtn.addEventListener('click', function(event) { var copyTextarea = document.getElementById("emailOutput"); copyTextarea.select(); try { var successful = document.execCommand('copy'); var msg = successful ? 'successful' : 'unsuccessful'; console.log('Copying text command was ' + msg); } catch (err) { console.log('Oops, unable to copy'); } }); </script>
  3. You can hide columns in tabular reports via css. The cascading should still work. #tabular table:nth-of-type(1) td:nth-of-type(4) {display: none;} #tabular table:nth-of-type(1) th:nth-of-type(4) {display: none;} 4 indicates the column number.
  4. If you code your scholarships datasource with a citizenship field scholarships name, type, citizenship and your Users table with a citizenship field users name, email, citizenship Then you can make a Scholarships Report, with Record Level Security, based on: Identitiy field in Authentication: Users_Citizenship Matching field in current data source: Scholarships_Citizenship
  5. The header field takes html line breaks. Add in source mode: <br /> In WYSIWYG mode, carriage returns should be honored, no need for \n.
  6. Insert an HTML block field, and in the source editor, do something like this: <a id="addToGoogle" href="https://www.google.com/calendar/render?action=TEMPLATE&amp;text=[@field:YourFieldHere]&amp;dates=[@field:YourFieldHere]&amp;details=[@field:YourFieldHere]&amp;location=[@field:YourFieldHere]&amp;sprop=[@field:YourFieldHere];sprop=[@field:YourFieldHere]:" class="button">Add to Google Calendar</a> I don't know what those sprop parameters at the end are doing. so for example where it says text=[@field=YourFieldHere], you would select the field with the name of your event as the field for that parameter: text=[@field=EventName]
  7. It sounds like you would like to have a button to increment or decrement the value of an item that you buy and sell. You can do this with Caspio using javascript, but it will involve more steps than the example that you linked, because you first must open an item for editing, then increment/decrement, then close the item to save your edit. More broadly though, you might want to instead build an Invoicing workflow and an Inventory workflow. The difference is that if you merely change the quantity of your item, you will have no history or paper trail of transactions--just the present value of the item qty.
  8. Bumping this. I can't find any documentation regarding search/replace syntax in Table view.
  9. you could try using Inline Edit with AJAX enabled to submit multiple records, though one at a time, without a page reload.
  10. When I had a similar need, I ended up using two datapages: one for the report and its functions, another for emails. In your case, the details page would link to a second datapage, that always sends emails on updates. This might work if you can separate the actions that should never trigger an email (let them do it on first page), and actions that should always trigger email (use link to 2nd datapage that always emails).
  11. Sorry, I was mistaken. This is very doable. I've successfully adapted the code on this page: click on any event here: https://london.techhub.com/events/ source code: <a id="addToGoogle" href="https://www.google.com/calendar/render?action=TEMPLATE&amp;text=VC%20Coffee%20Morning%20with%20BGF%20Ventures&amp;dates=20160915T090000Z/20160915T110000Z&amp;details=https://london.techhub.com/events/vc-coffee-morning-with-bgf-partners-1&amp;location=TechHub%20@%20Campus%20London&amp;sprop=&amp;sprop=name:" class="btn btn-primary btn-xs"><i class="fa fa-google-plus" yv6gjb9="" hidden=""></i>&nbsp;Google</a> <a id="addToOutlook" href="data:text/calendar;charset=utf8,BEGIN:VCALENDAR%0AVERSION:2.0%0ABEGIN:VEVENT%0AURL:https://london.techhub.com/events/vc-coffee-morning-with-bgf-partners-1%0ADTSTART:20160915T090000Z%0ADTEND:20160915T110000Z%0ASUMMARY:VC%20Coffee%20Morning%20with%20BGF%20Ventures%0ADESCRIPTION:https://london.techhub.com/events/vc-coffee-morning-with-bgf-partners-1%0ALOCATION:TechHub%20@%20Campus%20London%0AEND:VEVENT%0AEND:VCALENDAR" class="btn btn-primary btn-xs"><i class="fa fa-windows"></i>&nbsp;Outlook</a> You can put Caspio parameters in there.
  12. I found a neat script link: http://jsfiddle.net/7DT5z/9/ You would replace #word_count with the ID of your field.
  13. The className selectors are nice and clean in URL and Preview deployment. But when you use JS embed deployment on Report Datapages, unique IDs are appended to every class name on every page load. This has something to do with each record being a separate AJAX request, and inserting the response into the unique element. So I think if you inspect the page, you'll see that cbResultSetCalendarCaption becomes cbResultSetCalendarCaption_923746289379. So a different selector method is needed. In tabular datapage reports, the strategy everywhere on this forum is to use DOM node traversal by first creating a unique DIV for each record by inserting an HTML block field, with a <div id="@field:uniqueID"></div>. Now you have a starting point (document.getElementById("@field:uniqueID")), to traverse up (parentNode), down (childNode) etc. from. An alternative that can work in some cases is document.querySelectorAll, because it accepts wildcards, like contains,begins with, e.g. "CalendarCaption". link: http://stackoverflow.com/questions/8714090/queryselector-wildcard-element-match
  14. link: http://stackoverflow.com/questions/15712880/load-iframe-links-into-parent-window
  15. link: http://stackoverflow.com/questions/5913/getting-the-text-from-a-drop-down-box instead of setting your variable to a value, try to set it to the text of the selected <option> property for that field.
  16. you have to hover over links on this forum in order to see them due to a new bug. What is your date format? Can you paste an example? The idea is to split up the datetime string on a " ", then grab the piece you want from the resulting array, then combine it with another field. Caspio-how to concatenate: JS split function reference link: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split
  17. I don't know the details, but it's a security measure. Maybe you could google form input, sanitization, security, and character escaping together to see the general idea. It would make sense that they do more of this for auth fields, and not other fields. Just a guess. This doesn't have to do with your hostpage. On the bright side, the workaround seems pretty clean a straightforward to me.
  18. sorry, I opened this thread before MayMusic replied, but read it later, so I didn't see her post.
  19. Yes, lookup Views in the Caspio documentation. A View can combine Tables by joining them on matching ID fields.
  20. Try to add a class to the button, and put a CSS rule for the class in your Caspio or Site stylesheet. Add a class from linked How To, see bold: <input type="button" onClick="Displayer(1)" value="Personal Info"> with <img src="IMAGE URL " class="caspioPointer" onClick="Displayer(1)" > CSS .caspioPointer { cursor: pointer; } or for inline CSS, in your datapage footer, put <style> .caspioPointer { cursor: pointer; } </style> more options here http://www.w3schools.com/cssref/playit.asp?filename=playcss_cursor
  21. Where on your datapage are you calling your custom.js? Your script requires jQuery as well... Can you use inline javascript instead of an external file? The Caspio article on this is good:
  22. I think this is what's known as global namespace pollution. The quick fix here is to add a number next to every variable in each script, so that all variables are unique to each of your three scripts. e.g. v_state becomes v_state1 in script 1 v_state2 in script 2 etc. Edit: I don't think you have to do this for the functions, because the function limits the namespace.
  23. I took a look, and apparently the authfield output is being escaped by a preprocessor on the server before being sent...I guess security measures? You can use the following script to capture the output of the field from a hidden DIV, and use the text there as the HTML content of a second DIV that you display. <div id="escaped_html" style="display: none">[@authfield:company_footer_html]</div> <div id="unescaped_html"></div> <script> var userFooter = document.getElementById("escaped_html").innerText; document.getElementById("unescaped_html").innerHTML = userFooter; </script>
  24. Did you try using an app parameter instead of an auth parameter? link: http://howto.caspio.com/apps/app-parameters/
×
×
  • Create New...