globiws

video_master_detail_spreadsheet

Oct 28th, 2021 (edited)
579
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. For video: https://youtu.be/B5J8I2KYHlw
  2.  
  3. Video showing how to show an editable spreadsheet-like table of related items in a Podio app. In this example we have invoice items showing in an invoices app, but this technique is applicable to any master-detail relationship setup.
  4.  
  5. Some of the code used in the video:
  6.  
  7. -------------------------------
  8. Spreadsheet and button styling:
  9. -------------------------------
  10.  
  11. <style>
  12. * { font-size: 13px; }
  13. .pfui .tabsheet { max-height: unset; height: 100vh; }
  14. button.mybtnsmll {
  15. padding: 0.1em 0.5em;
  16. margin-left: 0;
  17. margin-right: 1em;
  18. }
  19. </style>
  20.  
  21. -------------------------------
  22. Invoice Field Default Value:
  23. -------------------------------
  24. @[pf_app_item:APP_ID_OF_YOUR_INVOICE_APP]
  25.  
  26. -------------------------------
  27. Before Process event:
  28. -------------------------------
  29. current_app_items[APP_ID_OF_YOUR_INVOICE_APP] = url_parameters.itemid
  30.  
  31. -------------------------------
  32. On Render code:
  33. -------------------------------
  34. var $btn = $("#btnadd");
  35. if ( $btn.length == 0 ) {
  36. addButton();
  37. }
  38.  
  39. function addButton() {
  40. $(".tabsheet").append('<button id="btnadd" class="mybtnsmll primary">+New</button>');
  41. $(".tabsheet").append('<button id="btnrefresh" class="mybtnsmll">Refresh</button>');
  42. $("#btnadd").on("click", function(e){
  43. e.preventDefault();
  44. e.stopImmediatePropagation();
  45. pfSheetWrapper.insertTabRow($(".tabsheet").first().attr("id"));
  46. });
  47. $("#btnrefresh").on("click", function(e){
  48. e.preventDefault();
  49. e.stopImmediatePropagation();
  50. document.location.reload();
  51. });
  52. }
  53.  
  54. -------------------------------
  55. Invoice App Line Items Calculation Field:
  56. -------------------------------
  57. // @Unique ID
  58. "[line items](https://procfu.com/widgets/mcapp/MINI_APP_URL_ID?itemid=@podio_item_id#globiflowiframe:250)"
  59.  
Add Comment
Please, Sign In to add comment