Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.71 KB | None | 0 0
  1. <apex:page controller="PLPcontroller" showHeader="false" standardStylesheets="false" sidebar="false" applyHtmlTag="false" applyBodyTag="false" docType="html-5.0">
  2.  
  3. <html xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" lang="en">
  4. <head>
  5. <meta charset="utf-8" />
  6. <meta http-equiv="x-ua-compatible" content="ie=edge" />
  7. <title>Lidl US</title>
  8. <meta name="viewport" content="width=device-width, initial-scale=1" />
  9. <apex:stylesheet value="{!URLFOR($Resource.LidlSFDesign, 'assets/styles/salesforce-lightning-design-system-vf.min.css')}" />
  10.  
  11. </head>
  12.  
  13. <apex:remoteObjects >
  14. <apex:remoteObjectModel name="ICIX_V1__ICIX_Product__c" fields="Id,Name,LastModifiedDate,ICIX_V1__ICIX_Product_ID__c,L1dlF0rm0rg__ELWIS_Product_Number__c,L1dlF0rm0rg__Item_Family_Picklist__c,L1dlF0rm0rg__Item_Family__c, L1dlF0rm0rg__Trading_Partner_Formula__c"/>
  15. <apex:remoteObjectModel name="ICIX_V1__PP_Relationship__c" fields="Id,Name,LastModifiedDate,RecordTypeId"/>
  16. </apex:remoteObjects>
  17.  
  18.  
  19. <body>
  20.  
  21. <!-- REQUIRED SLDS WRAPPER -->
  22. <div class="Lidl-Scoping">
  23.  
  24.  
  25. <!-- PAGE HEADER -->
  26.  
  27. <div class="slds-page-header" role="banner">
  28. <!-- LAYOUT GRID -->
  29. <div class="slds-grid">
  30.  
  31. <!-- GRID COL -->
  32. <div class="slds-col slds-has-flexi-truncate">
  33. <!-- HEADING AREA -->
  34.  
  35.  
  36.  
  37. <!-- MEDIA OBJECT = IcixProductIcon -->
  38. <div class="slds-media">
  39. <div class="slds-media__icon">
  40. <span class="icix-Products-icon">
  41. <img src="{!URLFOR($Resource.LidlSFDesign, 'assets/icons/custom/custom4_60.png')}" alt="" />
  42. </span>
  43. </div>
  44. <div class="slds-media__body">
  45. <h1 class="slds-page-header__title slds-s-right--small slds-align-relative slds-truncate" title="Product Listing Plan">Product Listing Plan</h1>
  46. </div>
  47. </div>
  48.  
  49. <!-- / MEDIA OBJECT -->
  50. <!-- / HEADING AREA -->
  51. </div>
  52.  
  53. <!-- ACTION BUTTONS -->
  54. <div class="slds-col slds-no-flex slds-grid slds-align-top slds-checkbox--faux">
  55. <div class="slds-button-group" role="group">
  56. <button class="slds-button slds-button--neutral">Refresh</button>
  57. <button class="slds-button slds-button--neutral">Edit</button>
  58. <button class="slds-button slds-button--neutral">Save</button>
  59. <button class="slds-button slds-button--neutral">
  60. <a href="" tabindex="-1" role="presentation" class="slds-truncate"> </a>
  61. New ICIX Product
  62. </button>
  63. <button class="slds-button slds-button--neutral">
  64. More
  65. </button>
  66. </div>
  67. </div>
  68. <!-- / ACTION BUTTONS -->
  69.  
  70. </div>
  71. <!-- / LAYOUT GRID -->
  72.  
  73. <!-- PAGE HEADER DETAIL ROW -->
  74.  
  75. <!-- / PAGE HEADER DETAIL ROW -->
  76.  
  77. </div>
  78. <!-- / PAGE HEADER -->
  79.  
  80. <!-- PRIMARY CONTENT WRAPPER -->
  81. <div class="myapp">
  82.  
  83. <!-- Product LIST TABLE -->
  84. <div id="prod-list" class="slds-p-vertical--medium"></div>
  85. <!-- / Product LIST TABLE -->
  86.  
  87. </div>
  88. <!-- / PRIMARY CONTENT WRAPPER -->
  89.  
  90. <!-- FOOTER -->
  91. <!-- / FOOTER -->
  92.  
  93. </div>
  94. <!-- / REQUIRED SLDS WRAPPER -->
  95.  
  96. <!-- JAVASCRIPT -->
  97. <script>
  98. (function() {
  99. var prod = new SObjectModel.ICIX_V1__ICIX_Product__c();
  100. var outputDiv = document.getElementById('prod-list');
  101.  
  102. var updateOutputDiv = function() {
  103.  
  104. prod.retrieve(
  105. { orderby: [{ LastModifiedDate: 'DESC' }], limit: 50 },
  106. function(error, records) {
  107. if (error) {
  108. alert(error.message);
  109. } else {
  110. // create data table
  111. var dataTable = document.createElement('table');
  112. dataTable.className = 'slds-checkbox--faux slds-table slds-table--bordered slds-table--cell-buffer slds-row-hover';
  113.  
  114. // add header row
  115. var tableHeader = dataTable.createTHead();
  116. var tableHeaderRow = tableHeader.insertRow();
  117.  
  118. var tableHeaderRowCell1 = tableHeaderRow.insertCell(0);
  119. tableHeaderRowCell1.setAttribute('input', 'slds-checkbox--faux');
  120. tableHeaderRowCell1.appendChild(document.createTextNode('Product name'));
  121. tableHeaderRowCell1.setAttribute('scope', 'col');
  122. tableHeaderRowCell1.setAttribute('class', 'slds-text-heading--label');
  123.  
  124.  
  125. var tableHeaderRowCell2 = tableHeaderRow.insertCell(1);
  126. tableHeaderRowCell2.setAttribute('checkbox', 'slds-checkbox--faux');
  127. tableHeaderRowCell2.appendChild(document.createTextNode('Item Family Description'));
  128. tableHeaderRowCell2.setAttribute('scope', 'col');
  129. tableHeaderRowCell2.setAttribute('class', 'slds-text-heading--label');
  130. tableHeaderRowCell2.setAttribute('input', 'slds-checkbox--small');
  131.  
  132. var tableHeaderRowCell3 = tableHeaderRow.insertCell(2);
  133. tableHeaderRowCell3.setAttribute('input', 'slds-checkbox--faux');
  134. tableHeaderRowCell3.appendChild(document.createTextNode('Item Group Description'));
  135. tableHeaderRowCell3.setAttribute('scope', 'col');
  136. tableHeaderRowCell3.setAttribute('class', 'slds-text-heading--label');
  137.  
  138.  
  139. var tableHeaderRowCell4 = tableHeaderRow.insertCell(3);
  140. tableHeaderRowCell4.setAttribute('input', 'slds-checkbox--faux');
  141. tableHeaderRowCell4.appendChild(document.createTextNode('ELWIS Item Number'));
  142. tableHeaderRowCell4.setAttribute('scope', 'col');
  143. tableHeaderRowCell4.setAttribute('class', 'slds-text-heading--label');
  144.  
  145.  
  146. var tableHeaderRowCell5 = tableHeaderRow.insertCell(4);
  147. tableHeaderRowCell5.setAttribute('input', 'slds-checkbox--faux');
  148. tableHeaderRowCell5.appendChild(document.createTextNode('Trading Partner'));
  149. tableHeaderRowCell5.setAttribute('scope', 'col');
  150. tableHeaderRowCell5.setAttribute('class', 'slds-text-heading--label');
  151.  
  152.  
  153. // build table body
  154. var tableBody = dataTable.appendChild(document.createElement('tbody'))
  155. var dataRow, dataRowCell1, dataRowCell2, dataRowCell3, dataRowCell4,dataRowCell5, recordName, recordId;
  156. records.forEach(function(record) {
  157. dataRow = tableBody.insertRow();
  158.  
  159. dataRowCell1 = dataRow.insertCell(0);
  160. recordName = document.createTextNode(record.get('Name'));
  161. dataRowCell1.appendChild(recordName);
  162.  
  163. dataRowCell2 = dataRow.insertCell(1);
  164. ItemFamily = document.createTextNode(record.get('L1dlF0rm0rg__Item_Family_Picklist__c'));
  165. dataRowCell2.appendChild(ItemFamily);
  166.  
  167. dataRowCell3 = dataRow.insertCell(2);
  168. ItemGroup = document.createTextNode(record.get('L1dlF0rm0rg__Item_Family__c'));
  169. dataRowCell3.appendChild(ItemGroup);
  170.  
  171. dataRowCell4 = dataRow.insertCell(3);
  172. ELWISId = document.createTextNode(record.get('L1dlF0rm0rg__ELWIS_Product_Number__c'));
  173. dataRowCell4.appendChild(ELWISId);
  174.  
  175. dataRowCell5 = dataRow.insertCell(4);
  176. TradingPartner = document.createTextNode(record.get('L1dlF0rm0rg__Trading_Partner_Formula__c'));
  177. dataRowCell5.appendChild(TradingPartner);
  178. });
  179.  
  180. if (outputDiv.firstChild) {
  181.  
  182. outputDiv.replaceChild(dataTable, outputDiv.firstChild);
  183. } else {
  184. outputDiv.appendChild(dataTable);
  185. }
  186. }
  187. }
  188. );
  189. }
  190. updateOutputDiv();
  191. })();
  192. </script>
  193. <script type="text/javascript">
  194. function selectAllCheckboxes(ICIX_V1__ICIX_Product__c,receivedInputID) {
  195. var inputCheckbox = document.getElementsByTagName("input");
  196. for(var i=0; i<inputCheckbox.length; i++) {
  197. if(inputCheckbox[i].id.indexOf(receivedInputID)!=-1) {
  198. inputCheckbox[i].checked = ICIX_V1__ICIX_Product__c.checked;
  199. }
  200. }
  201. }
  202. </script>
  203. <!-- / JAVASCRIPT -->
  204.  
  205. </body>
  206. </html>
  207. </apex:page>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement