Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!--Creating Case Header for table and Sorting Logic-->
- <div class="slds-hide" aura:id="CaseTable">
- <div class="slds-media__body ">
- <table class="slds-table slds-table_cell-buffer slds-max-medium-table_stacked-horizontal slds-table_bordered"
- role="grid" id="caseTable">
- <thead>
- <tr class="slds-text-title_caps slds-box slds-theme_shade">
- <th class="slds-is-sortable slds-text-title--caps" scope="col" onclick="{!c.sortLineNumber}">
- <a href="javascript:void(0);" class="slds-th__action slds-text-link--reset">
- <span class="slds-assistive-text">Sort</span>
- <span class="slds-truncate" title="Line Number">Line Number</span>
- <aura:if isTrue="{! and(v.arrowDirection == 'arrowdown', v.selectedTabsoft == 'LineNumber') }"> ▼ </aura:if>
- <aura:if isTrue="{! and(v.arrowDirection != 'arrowdown', v.selectedTabsoft == 'LineNumber') }"> ▲ </aura:if>
- </a>
- </th>
- <th class="slds-is-sortable slds-text-title--caps" scope="col" onclick="{!c.sortStatus}">
- <a href="javascript:void(0);" class="slds-th__action slds-text-link--reset">
- <span class="slds-assistive-text">Sort</span>
- <span class="slds-truncate" title="Status">Status</span>
- <aura:if isTrue="{! and(v.arrowDirection == 'arrowdown', v.selectedTabsoft == 'Status') }"> ▼ </aura:if>
- <aura:if isTrue="{! and(v.arrowDirection != 'arrowdown', v.selectedTabsoft == 'Status') }"> ▲ </aura:if>
- </a>
- </th>
- <th class="slds-is-sortable slds-text-title--caps" scope="col" onclick="{!c.sortSubStatus}">
- <a href="javascript:void(0);" class="slds-th__action slds-text-link--reset">
- <span class="slds-assistive-text">Sort</span>
- <span class="slds-truncate" title="Sub Status">Sub Status</span>
- <aura:if isTrue="{! and(v.arrowDirection == 'arrowdown', v.selectedTabsoft == 'SubStatus') }"> ▼ </aura:if>
- <aura:if isTrue="{! and(v.arrowDirection != 'arrowdown', v.selectedTabsoft == 'SubStatus') }"> ▲ </aura:if>
- </a>
- </th>
- <th class="slds-is-sortable slds-text-title--caps" scope="col" onclick="{!c.sortJobType}">
- <a href="javascript:void(0);" class="slds-th__action slds-text-link--reset">
- <span class="slds-assistive-text">Sort</span>
- <span class="slds-truncate" title="Job Type">Job Type</span>
- <aura:if isTrue="{! and(v.arrowDirection == 'arrowdown', v.selectedTabsoft == 'JobType') }"> ▼ </aura:if>
- <aura:if isTrue="{! and(v.arrowDirection != 'arrowdown', v.selectedTabsoft == 'JobType') }"> ▲ </aura:if>
- </a>
- </th>
- <th class="slds-is-sortable slds-text-title--caps" scope="col" onclick="{!c.sortSerialReceived}">
- <a href="javascript:void(0);" class="slds-th__action slds-text-link--reset">
- <span class="slds-assistive-text">Sort</span>
- <span class="slds-truncate" title="Serial#/Received Serial#">Serial#/Received Serial#</span>
- <aura:if isTrue="{! and(v.arrowDirection == 'arrowdown', v.selectedTabsoft == 'SerialReceived') }"> ▼ </aura:if>
- <aura:if isTrue="{! and(v.arrowDirection != 'arrowdown', v.selectedTabsoft == 'SerialReceived') }"> ▲ </aura:if>
- </a>
- </th>
- <th class="slds-is-sortable slds-text-title--caps" scope="col" onclick="{!c.sortProduct}">
- <a href="javascript:void(0);" class="slds-th__action slds-text-link--reset">
- <span class="slds-assistive-text">Sort</span>
- <span class="slds-truncate" title="Product">Product</span>
- <aura:if isTrue="{! and(v.arrowDirection == 'arrowdown', v.selectedTabsoft == 'Product') }"> ▼ </aura:if>
- <aura:if isTrue="{! and(v.arrowDirection != 'arrowdown', v.selectedTabsoft == 'Product') }"> ▲ </aura:if>
- </a>
- </th>
- <th class="slds-is-sortable slds-text-title--caps" scope="col" onclick="{!c.sortReceivedPart}">
- <a href="javascript:void(0);" class="slds-th__action slds-text-link--reset">
- <span class="slds-assistive-text">Sort</span>
- <span class="slds-truncate" title="Received Part#">Received Part#</span>
- <aura:if isTrue="{! and(v.arrowDirection == 'arrowdown', v.selectedTabsoft == 'ReceivedPart') }"> ▼ </aura:if>
- <aura:if isTrue="{! and(v.arrowDirection != 'arrowdown', v.selectedTabsoft == 'ReceivedPart') }"> ▲ </aura:if>
- </a>
- </th>
- <th class="slds-is-sortable slds-text-title--caps" scope="col" onclick="{!c.sortReceivedDate}">
- <a href="javascript:void(0);" class="slds-th__action slds-text-link--reset">
- <span class="slds-assistive-text">Sort</span>
- <span class="slds-truncate" title="Received Date">Received Date</span>
- <aura:if isTrue="{! and(v.arrowDirection == 'arrowdown', v.selectedTabsoft == 'ReceivedDate') }"> ▼ </aura:if>
- <aura:if isTrue="{! and(v.arrowDirection != 'arrowdown', v.selectedTabsoft == 'ReceivedDate') }"> ▲ </aura:if>
- </a>
- </th>
- <th class="slds-is-sortable slds-text-title--caps" scope="col" onclick="{!c.sortExpectedSerial}">
- <a href="javascript:void(0);" class="slds-th__action slds-text-link--reset">
- <span class="slds-assistive-text">Sort</span>
- <span class="slds-truncate" title="Expected Serial#">Expected Serial#</span>
- <aura:if isTrue="{! and(v.arrowDirection == 'arrowdown', v.selectedTabsoft == 'ExpectedSerial') }"> ▼ </aura:if>
- <aura:if isTrue="{! and(v.arrowDirection != 'arrowdown', v.selectedTabsoft == 'ExpectedSerial') }"> ▲ </aura:if>
- </a>
- </th>
- <th class="slds-is-sortable slds-text-title--caps" scope="col" onclick="{!c.sortExpectedPart}">
- <a href="javascript:void(0);" class="slds-th__action slds-text-link--reset">
- <span class="slds-assistive-text">Sort</span>
- <span class="slds-truncate" title="Expected Part#">Expected Part#</span>
- <aura:if isTrue="{! and(v.arrowDirection == 'arrowdown', v.selectedTabsoft == 'ExpectedPart') }"> ▼ </aura:if>
- <aura:if isTrue="{! and(v.arrowDirection != 'arrowdown', v.selectedTabsoft == 'ExpectedPart ') }"> ▲ </aura:if>
- </a>
- </th>
- <th class="slds-is-sortable slds-text-title--caps" scope="col" onclick="{!c.sortGLCode}">
- <a href="javascript:void(0);" class="slds-th__action slds-text-link--reset">
- <span class="slds-assistive-text">Sort</span>
- <span class="slds-truncate" title="GL Code">GL Code</span>
- <aura:if isTrue="{! and(v.arrowDirection == 'arrowdown', v.selectedTabsoft == 'GLCode') }"> ▼ </aura:if>
- <aura:if isTrue="{! and(v.arrowDirection != 'arrowdown', v.selectedTabsoft == 'GLCode') }"> ▲ </aura:if>
- </a>
- </th>
- <th class="slds-is-sortable slds-text-title--caps" scope="col" onclick="{!c.sortShipToCountry}">
- <a href="javascript:void(0);" class="slds-th__action slds-text-link--reset">
- <span class="slds-assistive-text">Sort</span>
- <span class="slds-truncate" title="ShipTo Country">ShipTo Country</span>
- <aura:if isTrue="{! and(v.arrowDirection == 'arrowdown', v.selectedTabsoft == 'ShipToCountry') }"> ▼ </aura:if>
- <aura:if isTrue="{! and(v.arrowDirection != 'arrowdown', v.selectedTabsoft == 'ShipToCountry') }"> ▲ </aura:if>
- </a>
- </th>
- </tr>
- </thead>
- <!--Querying the data and showing in Table-->
- <tbody>
- <aura:iteration items="{!v.caseDetails}" var="caseDetail">
- <tr scope="row" class="slds-hint-parent">
- <td scope="row" role="gridcell" data-label="Line Number"
- class="slds-cell-wrap slds-size_2-of-24">
- <div title="Line Number">{!caseDetail.LN_NUM__c}</div>
- </td>
- <td scope="row" role="gridcell" data-label="Status"
- class="slds-cell-wrap slds-size_2-of-24">
- <div title="Status">{!caseDetail.LINE_STATUS__c}</div>
- </td>
- <td scope="row" role="gridcell" data-label="Sub Status"
- class="slds-cell-wrap slds-size_2-of-24">
- <div title="Sub Status">{!caseDetail.FSREPAIR_SUB_STATUS__c}</div>
- </td>
- <td scope="row" role="gridcell" data-label="Job Type"
- class="slds-cell-wrap slds-size_2-of-24">
- <div title="Job Type">{!caseDetail.JOB_TYPE__c}</div>
- </td>
- <td scope="row" role="gridcell" data-label="Received Serial"
- class="slds-cell-wrap slds-size_2-of-24">
- <div title="Received Serial">{!caseDetail.RECEIVED_SERIAL_NUM__c}</div>
- </td>
- <td scope="row" role="gridcell" data-label="Product"
- class="slds-cell-wrap slds-size_2-of-24">
- <div title="Product">{!caseDetail.PRODUCT__c}</div>
- </td>
- <td scope="row" role="gridcell" data-label="Received Part#"
- class="slds-cell-wrap slds-size_2-of-24">
- <div title="Received Part#">{!caseDetail.RECEIVED_PART_NUM__c}</div>
- </td>
- <td scope="row" role="gridcell" data-label="Received Date"
- class="slds-cell-wrap slds-size_2-of-24">
- <div title="Received Date">
- <lightning:formattedDateTime aura:id="thresholdRunOn"
- value="{!caseDetail.RECEIVED_DATE__c}"
- month="short"
- day="numeric"
- year="numeric"
- hour="2-digit"
- minute="2-digit"
- second="2-digit"
- hour12="true"
- timeZone="{!$Locale.timezone}"/>
- </div>
- </td>
- <td scope="row" role="gridcell" data-label="Expected Serial#"
- class="slds-cell-wrap slds-size_2-of-24">
- <div title="Expected Serail#">{!caseDetail.EXPECTED_SERIAL_NUM__c}</div>
- </td>
- <td scope="row" role="gridcell" data-label="Expected Part#"
- class="slds-cell-wrap slds-size_2-of-24">
- <div title="Expected Part#">{!caseDetail.EXPECTED_PART_NUM__c}</div>
- </td>
- <td scope="row" role="gridcell" data-label="GL Code"
- class="slds-cell-wrap slds-size_2-of-24">
- <div title="GL Code">{!caseDetail.FRR_CODE__c}</div>
- </td>
- <td scope="row" role="gridcell" data-label="ShipTo Country"
- class="slds-cell-wrap slds-size_2-of-24">
- <div title="ShipTo Country">{!caseDetail.SHIP_TO_COUNTRY__c}</div>
- </td>
- </tr>
- </aura:iteration>
- </tbody>
- </table>
- </div>
- <!--Creating Pagination at the end-->
- <lightning:layout multipleRows="false" horizontalAlign="space" verticalAlign="end" aura:id="pagination">
- <lightning:layoutItem padding="around-large" size="12" flexibility="auto" smallDeviceSize="12"
- largeDeviceSize="4" mediumDeviceSize="4">
- <c:Pagination currentPageNumber="{!v.pageNumber}" maxPageNumber="{!v.maxPage}"/>
- </lightning:layoutItem>
- </lightning:layout>
- </div>
- </div>
- `I created a slds table to display the list of data but it is moving out of boundary when I increase browser zoom.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement