Jump to content

Pumpedplop

Caspio Ninja
  • Posts

    31
  • Joined

  • Last visited

About Pumpedplop

  • Birthday November 4

Recent Profile Visitors

160 profile views
  1. Hello, @Volomeister The workflow would be that they create a new item, where 4 files need to be connected to. They would look (using select file from list) trough a list to see if it is already uploaded, Else they would need to upload the new file. That is why I would need a solution using one datapage, because it could be any configuration of the 4 different files that needed to be selected or uploaded.
  2. Hello, I'm trying to find a way to reduce redundant files on my caspio application the ideal way would be to give the option to an admin user, to upload a new file or link an already existing file. Is this possible?
  3. Thank you, @CoopperBackpack But I looked over the fact that sometimes the URL doesn't end on _.PDF but just .PDF, I tried fixing your code myself but it still didn't work. Any fixes?
  4. I am searching for a way that if the original sorting field ( the left field) is empty the value of the dropdown virtual field is used ( if any are selected), is there a way to do this? Thanks in advance
  5. So I have this problem that I have saved a series of URL's , but I need a specific part of said url (marked in the picture). I can not share the complete URL but the most left e you can see, is from the ".be" of the url. Does anyone know a solution? (I can't do it manually because there are already 1300 entries)
  6. I contacted caspio support and they were able to create the code below for my datapage. This code should be installed in the footer. Hopefully this helps someone else with the same problem. <script> if (typeof getValuesArr=='undefined') { const INPUT_SELECTOR = '[id^="Value3_1"]' const getValuesArr = HTMLSelect => { let valuesArr = [] HTMLSelect.querySelectorAll('option').forEach(option=>{ valuesArr.push(option.value) }) return valuesArr } const sortValuesArr = numbersAsStr => { numbersAsStr.sort((a, b) => { if (parseInt(a) > parseInt(b)) return 1 if (parseInt(a) < parseInt(b)) return -1 return 0 }) return numbersAsStr } const generateOptionsTemplate = (sortedValuesArr) => { let optionsTemplateStr = '' for (let i=0; i<sortedValuesArr.length;i++) { optionsTemplateStr += `<option custom-sorting="sorted" value="${sortedValuesArr[i]}">${sortedValuesArr[i]}</option>` } return optionsTemplateStr } const addObserver = (HTMLEl) => { new MutationObserver( (mutations) => { console.log('mutation fired') for (let i=0; i<mutations.length; i++) { if(mutations[i].target != document.querySelector(INPUT_SELECTOR)) continue if(mutations[i].addedNodes.length == 0) continue if (mutations[i].addedNodes[0].getAttribute('custom-sorting') == 'sorted') { break} if (mutations[i].addedNodes[0].tagName == 'OPTION') { window.setTimeout(()=>{ document.querySelector(INPUT_SELECTOR).innerHTML=generateOptionsTemplate(sortValuesArr(getValuesArr(document.querySelector(INPUT_SELECTOR)))) }, 250) break } } }).observe(document.querySelector('body'), {childList: true, subtree: true}) } //document.querySelector(INPUT_SELECTOR).parentElement.parentElement const mainFun = () => { const input = document.querySelector(INPUT_SELECTOR) input.innerHTML = generateOptionsTemplate(sortValuesArr(getValuesArr(input))) addObserver(input) document.removeEventListener('DataPageReady', mainFun ) } document.addEventListener('DataPageReady', mainFun ) } </script>
  7. I have a dropdown sorting issue, the issue is that I have to use a text datatype because the numbers sometimes contain a hyphen. This makes it not sort properly from smallest number to larger (everything that is behind the hyphen does not matter). Anyone know a solution?
  8. Hello, The code below fixes the issue if you are using chrome, when using Firefox it opens a complete extra tab that is not needed. Code: <a target="_blank" class='cbMenuItem' href='#' onclick='$("#right_frame").contents().find("#caspioform").submit(); window.open("[@app:URL_F]?Onderdeel_Nummer=[@field:Nummer]&ID=[@ID]&Type=[@field:Type]&Onderdeel=[@field:Onderdeel]&Aantal=[@field:Aantal]&Prijs_Onderdeel=[@field:Prijs_Onderdeel]&Korting_Percent=0&Datum=[@field:Datum_prijslijst]","mywindow", "menubar=1,resizable=1,width=2,height=2"); ' >ADD</a>
  9. Hello, @autonumber The ADD button links to a backbone submit page, this is so when people click ADD on the left page that line from the left gets copied to the datatable that is loaded on the right. This happens by sending all parameters from that line to a submission form which auto submits into the datatable. So it opens a new webpage in a small window in a complete separate browser window for a small amount of time before the form auto submits.
  10. Hello, I was just wondering if there is a way to access a directory from a datapage, to make it easier for an admin user to activate and allow users to use the pages. I know I can build it myself using some tables and views but directories would really simplify the whole deal and make login in easier.
  11. Hello, I also have encounterd issues with aggregates and hidding certain collumns, From a different post ( I can not find it) I tried this solution but my aggregate still isn't displaying anything if I remove the code to hide the columns the aggregate does work.
  12. Hello I can not really imagine a proper usecase for this. Please enlighten me with one. Pump
  13. Hello, @tborley I found that this is exaclty what I want to do, and was just wondering if you found a working solution in the end. And if you were willing to share it.
  14. The code works but looks clumsy refreshing the page, that's why I tried altering the code to click the actual search button with information gathered from (Auto search Caspio forums). This doesn't seem to work, can you see any reason why? <script> var thisDP = document.querySelector(`[action*="[@cbAppKey]"]`); var time = new Date().getTime(); $(document.body).bind("mousemove keypress", function(e) { time = new Date().getTime(); }); function refresh() { if(new Date().getTime() - time >= 60000) console.log('Clicked'); thisDP.querySelector('.cbSearchButton').click(); else setTimeout(refresh, 10000); } setTimeout(refresh, 10000); </script>
  15. If I would use this code on my caspio page, where would I need to place it?
×
×
  • Create New...