Skip to main content

Latest Post

The Ego in the Machine: Is Our Need for Validation Creating an Existential Threat?

Technology has always been a bridge, but today, it feels more like a mirror. With the rapid rise of AI , we are seeing things enter our lives and leave them at a pace we can barely track. To understand where this is going, we first have to understand how technology actually impacts the core of who we are. The Survivalist vs. The Ego Our minds are biologically wired for one thing: survival . We are designed to handle the worst-case scenario, an ancient instinct gifted to us by nature. We consider ourselves conscious decision-makers, but a critical question remains: Who is really making the call?

Drag and drop, show and hide columns styling with SLDS Customize list view Visualforce Page and JQuery

Here is sample code for who wants drag and drop, Show and hide functionality in visualforce page using SLDS styling. In this code we are using JQuery, SLDS, Visualforce page.
Customize List View 
Sample Visualforce Page:- 
<apex:page showHeader="false" doctype="html-5.0"  sidebar="false" lightningStylesheets="true">

    <html xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" lang="en">
        <head>
            <!-- Import the Design System style sheet -->
            <apex:slds /> 
            <link rel="stylesheet" href="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css"/>
            <link rel="stylesheet" href="https://cdn.datatables.net/fixedheader/3.1.5/css/fixedHeader.dataTables.min.css"/>
            <link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.5.6/css/buttons.dataTables.min.css"/>
            <style>              
                .slds-scope hr {
                display: block;
                margin: 0.5rem 0;
                border-top: 1px solid rgb(221, 219, 218);
                height: 1px;
                clear: both;
                }
                #data th, #pendingRequests th
                {
                background-color:#539fc6 !important ;
                color:white;
                vertical-align:middle;
                }
                #data tr td, #pendingRequests tr td
                {
                vertical-align:middle;
                }
                #link:hover{
                opacity: 1;
                background-color:#539fc6;
                }
                
                th{
                box-sizing: border-box;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;
                }
                
                <!-- add for dynamic column css -->
                .slds-scope .slds-icon-text-default {
                fill: rgb(255, 255, 255) !important;
                }
                button.dt-button.active {
                background: #539fc6 !important;
                color:white;
                font-weight: bold !important;
                }
                .dt-button-collection{
                width: auto !important;
                top: 35% !important;
                left: 4% !important;
                margin-left: 38% !important;
                position: fixed !important;
                margin-top: -175px !important;
                }
                .buttons-colvis {
                background: #539fc6 !important;
                color: white !important;
                font-weight: bold !important;
                }
                .dt-button-collection {
                max-height: 500px !important;
                overflow-y: auto !important;
                }
                .dt-buttons{
                margin-left: -14em !important;
                }
                .dataTables_length{
                margin-left: 5em !important;
                position:relative !important;
                z-index : 10;
                }
                .paginate_button.current{
                background: linear-gradient(to bottom, #fff 0%, #539fc6 100%) !important;
                }
                .slds-icon-eq__bar {
                background: #539fc6 !important;     
                } 
                .reset-button{
                background: #539fc6 !important;
                margin-left: 12em !important;
                color:white !important;
                padding: 9px !important;
                }      
            </style>
        </head>        
        <body>
            <apex:form >
                <div class="slds-scope slds-theme_shade slds-theme_alert-texture slds-form-element" style="min-height:96.5vh;background-color:white;padding:0px;margin:0px;">                    
                    <div class="container-fluid " id="tab-default-5"  style="background-color:white;border:0px solid #DCDCDC;">
                        <div class="slds-grid slds-gutters" style="margin-right: 2%;margin-left: 2%;">
                            <div style="padding: 0.5%;width: 142px; " class="slds-col">
                                <span Id="messageTitle"><span class="slds-icon_container slds-icon_container_circle slds-icon-action-flow" title="Description of icon when needed">
                                    <svg class="slds-icon slds-icon_small" aria-hidden="true">
                                        <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/apexpages/slds/latest/assets/icons/action-sprite/svg/symbols.svg#record"></use>
                                    </svg>
                                    <span class="slds-assistive-text">Description of icon when needed</span>
                                    </span>
                                    List Reocrds </span>                            
                                <apex:commandLink action="{!}" target="blank" styleClass="slds-button slds-button_brand" style="font-weight:bold;text-align:right;background-color:#539fc6;" >
                                    New 
                                </apex:commandLink>                            
                            </div>
                            <div style="padding: 0.5%;" class="slds-col">
                                <div class="slds-form-element__control">
                                    
                                </div>
                            </div>
                            <div class="slds-col" style="padding: 0.5%;">
                                <div class="slds-icon-eq slds-is-animated" style="left: 85%;top: 27%;" title="Progress of Requests">
                                    
                                    <div class="slds-icon-eq__bar"></div>
                                    <div class="slds-icon-eq__bar"></div>
                                    <div class="slds-icon-eq__bar"></div>
                                    <span class="slds-assistive-text">
                                    </span>
                                </div>
                            </div>
                        </div>
                        
                        <hr/>
                        <div  style="width:100%;padding-left:2%;padding-right:2%; overflow-x: scroll;" styleclass="slds-table slds-table_cell-buffer slds-table_bordered slds-table_striped">
                            <!--<span style = "font-size:16px;"> All Requests   </span><hr/>-->                            
                            <apex:outputPanel Id="RequestTable">
                                <table id="data" class="table-striped table-bordered display responsive nowrap" cellspacing="0" style="width:100%;table-layout:fixed">                               
                                    <thead>                                
                                        <tr>
                                            <th >
                                                <span class="slds-icon_container slds-icon-standard-opportunity slds-m-right_xx-small" title="Account">
                                                    <svg class="slds-icon slds-icon_x-small" aria-hidden="true">
                                                        <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/apexpages/slds/latest/assets/icons/standard-sprite/svg/symbols.svg#opportunity"></use>
                                                    </svg>
                                                    <span class="slds-assistive-text">Column 1</span>
                                                </span>
                                                Column 1
                                            </th>                                            
                                            <th >
                                                <span class="slds-icon_container slds-icon-standard-opportunity slds-m-right_xx-small" title="Account">
                                                    <svg class="slds-icon slds-icon_x-small" aria-hidden="true">
                                                        <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/apexpages/slds/latest/assets/icons/standard-sprite/svg/symbols.svg#call"></use>
                                                    </svg>
                                                    <span class="slds-assistive-text">Column 2</span>
                                                </span>
                                                Column 2
                                            </th>
                                            <th >
                                                <span class="slds-icon_container slds-icon-standard-opportunity slds-m-right_xx-small" title="Account">
                                                    <svg class="slds-icon slds-icon_x-small" aria-hidden="true">
                                                        <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/apexpages/slds/latest/assets/icons/standard-sprite/svg/symbols.svg#case"></use>
                                                    </svg>
                                                    <span class="slds-assistive-text">Column 3</span>
                                                </span>
                                                Column 3
                                            </th>
                                            <th >
                                                <span class="slds-icon_container slds-icon-standard-opportunity slds-m-right_xx-small" title="Account">
                                                    <svg class="slds-icon slds-icon_x-small" aria-hidden="true">
                                                        <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/apexpages/slds/latest/assets/icons/standard-sprite/svg/symbols.svg#chart"></use>
                                                    </svg>
                                                    <span class="slds-assistive-text">Column 4</span>
                                                </span>
                                                Column 4
                                            </th>
                                            <th >
                                                <span class="slds-icon_container slds-icon-standard-opportunity slds-m-right_xx-small" title="Account">
                                                    <svg class="slds-icon slds-icon_x-small" aria-hidden="true">
                                                        <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/apexpages/slds/latest/assets/icons/standard-sprite/svg/symbols.svg#coaching"></use>
                                                    </svg>
                                                    <span class="slds-assistive-text">Column 5</span>
                                                </span>
                                                Column 5
                                            </th>
                                            <th >
                                                <span class="slds-icon_container slds-icon-standard-opportunity slds-m-right_xx-small" title="Account">
                                                    <svg class="slds-icon slds-icon_x-small" aria-hidden="true">
                                                        <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/apexpages/slds/latest/assets/icons/standard-sprite/svg/symbols.svg#cms"></use>
                                                    </svg>
                                                    <span class="slds-assistive-text">Column 6</span>
                                                </span>
                                                Column 6
                                            </th>
                                            <th >
                                                <span class="slds-icon_container slds-icon-standard-opportunity slds-m-right_xx-small" title="Account">
                                                    <svg class="slds-icon slds-icon_x-small" aria-hidden="true">
                                                        <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/apexpages/slds/latest/assets/icons/standard-sprite/svg/symbols.svg#client"></use>
                                                    </svg>
                                                    <span class="slds-assistive-text">Column 7</span>
                                                </span>
                                                Column 7
                                            </th>
                                            <th >
                                                <span class="slds-icon_container slds-icon-standard-opportunity slds-m-right_xx-small" title="Account">
                                                    <svg class="slds-icon slds-icon_x-small" aria-hidden="true">
                                                        <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/apexpages/slds/latest/assets/icons/standard-sprite/svg/symbols.svg#decision"></use>
                                                    </svg>
                                                    <span class="slds-assistive-text">Column 8</span>
                                                </span>
                                                Column 8
                                            </th>
                                            <th >
                                                <span class="slds-icon_container slds-icon-standard-opportunity slds-m-right_xx-small" title="Account">
                                                    <svg class="slds-icon slds-icon_x-small" aria-hidden="true">
                                                        <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/apexpages/slds/latest/assets/icons/standard-sprite/svg/symbols.svg#datadotcom"></use>
                                                    </svg>
                                                    <span class="slds-assistive-text">Column 9</span>
                                                </span>
                                                Column 9
                                            </th>
                                            <th >
                                                <span class="slds-icon_container slds-icon-standard-opportunity slds-m-right_xx-small" title="Account">
                                                    <svg class="slds-icon slds-icon_x-small" aria-hidden="true">
                                                        <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/apexpages/slds/latest/assets/icons/standard-sprite/svg/symbols.svg#drafts"></use>
                                                    </svg>
                                                    <span class="slds-assistive-text">Column 10</span>
                                                </span>
                                                Column 10
                                            </th>
                                            <th >
                                                <span class="slds-icon_container slds-icon-standard-opportunity slds-m-right_xx-small" title="Account">
                                                    <svg class="slds-icon slds-icon_x-small" aria-hidden="true">
                                                        <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/apexpages/slds/latest/assets/icons/standard-sprite/svg/symbols.svg#dataset"></use>
                                                    </svg>
                                                    <span class="slds-assistive-text">Column 11</span>
                                                </span>
                                                Column 11
                                            </th>                                            
                                        </tr>
                                    </thead>
                                    <tbody>                        
                                        <tr>
                                            <td>
                                                Value 1 
                                            </td>
                                            <td>
                                                Value 2 
                                            </td>  
                                            <td>
                                                Value 3 
                                            </td>  
                                            <td>
                                                Value 4 
                                            </td>  
                                            <td>
                                                Value 5 
                                            </td>  
                                            <td>
                                                Value 6 
                                            </td>  
                                            <td>
                                                Value 7 
                                            </td>
                                            <td>
                                                Value 8 
                                            </td>       
                                            <td>
                                                Value 9 
                                            </td>       
                                            <td>
                                                Value 10 
                                            </td>       
                                            <td>
                                                Value 11 
                                            </td>                                                         
                                        </tr>
                                        <tr>
                                            <td>
                                                Value 1 
                                            </td>
                                            <td>
                                                Value 2 
                                            </td>  
                                            <td>
                                                Value 3 
                                            </td>  
                                            <td>
                                                Value 4 
                                            </td>  
                                            <td>
                                                Value 5 
                                            </td>  
                                            <td>
                                                Value 6 
                                            </td>  
                                            <td>
                                                Value 7 
                                            </td>
                                            <td>
                                                Value 8 
                                            </td>       
                                            <td>
                                                Value 9 
                                            </td>       
                                            <td>
                                                Value 10 
                                            </td>       
                                            <td>
                                                Value 11 
                                            </td>                                                         
                                        </tr>
                                    </tbody>                                 
                                </table>                        
                            </apex:outputPanel>                         
                        </div>                  
                    </div>
                </div>
                
                <script type="text/javascript" charset="utf8" src="https://code.jquery.com/jquery-3.3.1.js"></script> 
                <script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script> 
                <script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/fixedheader/3.1.5/js/dataTables.fixedHeader.min.js"></script> 
                <script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/buttons/1.5.6/js/dataTables.buttons.min.js"></script> 
                <script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/buttons/1.5.6/js/buttons.colVis.min.js"></script>
                <script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/colreorder/1.5.1/js/dataTables.colReorder.min.js"></script>
                
                <script>
                $("#fourthTab").on("click",function(){
                    $("#tab-default-5").addClass("slds-hide");
                    $("#fifthTab").removeClass("slds-is-active");
                    $("#fourthTab").addClass("slds-is-active");
                    $("#tab-default-4").addClass("slds-show");
                    $("#tab-default-4").removeClass("slds-hide");
                });
                $(document).ready(function() {
                    var table = $('#data').DataTable( {
                        "lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
                        "order": [],
                        stateSave: true,
                        responsive: true,
                        colReorder: true,
                        "scrollX": false,
                        dom: 'lBfrtip',
                        "columnDefs": [
                            {
                                "targets": "hide-default",
                                "visible": false,
                                "searchable": false,
                                "orderable": false
                            },
                            {
                                "targets": [ 10 ],
                                "visible": false,
                                "searchable": false,
                                "orderable": false
                            }
                            
                        ],
                        buttons: [
                            'colvis',
                            {
                                text: 'Reset',
                                className: 'reset-button',
                                action: function ( e, dt, node, config ) {
                                    localStorage.clear();
                                    location.reload();
                                }
                            }
                            
                        ],
                        language: {
                            searchPlaceholder: "Search records"
                        }
                    } );
                    $(".buttons-colvis").empty();
                    $(".buttons-colvis").append(
                        "\n <span class='slds-icon_container slds-icon-utility-settings' title='Description of icon when needed'>\n                              <svg class='slds-icon slds-icon-text-default slds-icon_small' aria-hidden='true'>\n                                <use xmlns:xlink='http://www.w3.org/1999/xlink' xlink:href='/apexpages/slds/latest/assets/icons/utility-sprite/svg/symbols.svg#settings'></use>\n                              </svg>\n                              <span class='slds-assistive-text'>Column Visibility</span>\n                            </span>\n                         "
                    );
                } );
                </script>
            </apex:form>
        </body>        
    </html>
</apex:page>

Popular Posts

Dynamic Conditional Rendering in LWC: Implementing IF:TRUE

Introduction: In Lightning Web Components (LWC), conditional rendering allows us to selectively display or hide elements based on certain conditions. One common scenario is rendering content when a condition evaluates to true. In this blog post, we will explore how to implement dynamic conditional rendering using the IF:TRUE directive in LWC. We will walk through an example to demonstrate a full working code that achieves this functionality. Let's get started!

Demystifying Batch Processing in Salesforce

Introduction: Batch processing is a powerful feature in Salesforce that allows you to efficiently process large volumes of data in chunks. In this blog post, we will explore the concept of batch processing, its benefits, and provide code examples to demonstrate how to implement a batch class in Salesforce. What is Batch Processing? Batch processing is a technique used to process a large amount of data in smaller, manageable chunks. It breaks down a large job into multiple smaller jobs called batches, which are processed sequentially. This approach is particularly useful when dealing with large datasets that would otherwise exceed governor limits in a single execution.

LWC Full Dynamic Working Code for Useful JavaScript Methods in LWC

Introduction: Welcome to Part 3 of our blog series on building Lightning Web Components (LWC) with full dynamic working code. In this installment, we will continue exploring some useful JavaScript methods that can enhance the functionality and interactivity of your LWC applications. By the end of this article, you'll have a solid understanding of how to leverage these methods to create dynamic and efficient LWC components. So let's dive in!

Enhancing Data Security with Salesforce: Key Features and Best Practices

Introduction: In today's digitally driven world, data security is of paramount importance for businesses. With the increasing adoption of cloud-based solutions, ensuring the protection of sensitive customer information is crucial. Salesforce, a leading customer relationship management (CRM) platform, offers a robust set of security features to safeguard your organization's data. In this blog post, we will explore some of the essential Salesforce security features and discuss best practices for maximizing data security within the platform.

Artificial Intelligence Fundamentals in Salesforce

Introduction: Artificial Intelligence (AI) has revolutionized various industries, and Salesforce, a leading customer relationship management (CRM) platform, has embraced AI to enhance its capabilities. Salesforce leverages AI to provide personalized customer experiences, automate tasks, and gain valuable insights. In this blog post, we will explore the fundamentals of AI in Salesforce, highlighting its key components and benefits. 1. Understanding Artificial Intelligence: Artificial Intelligence refers to the simulation of human intelligence in machines, enabling them to perform tasks that typically require human intelligence. AI encompasses various technologies such as machine learning, natural language processing, and computer vision, among others. 2. AI in Salesforce: Salesforce has incorporated AI into its platform through its AI-powered product called Einstein. Einstein brings intelligent features to Salesforce, empowering businesses to make data-driven decisions, automate ...

Building a Dynamic Device Form Factor in LWC for Salesforce

Introduction: In today's rapidly evolving digital landscape, creating user-friendly and responsive interfaces is crucial. Salesforce Lightning Web Components (LWC) provide a powerful framework for building interactive and efficient applications. In this blog post, we will explore how to develop a dynamic device form factor in LWC, allowing your application to adapt seamlessly across various screen sizes and devices.

Uncommitted Work Pending in Salesforce: Handling and Best Practices

Introduction: In Salesforce development, you might encounter the error message "Y ou have uncommitted work pending. Please commit or rollback before calling out. " This error occurs when you try to make an HTTP callout or perform a DML operation after performing a DML operation but before committing the transaction. In this blog post, we will explore what causes this error, why it is important to handle it properly, and provide code examples to illustrate how to resolve it.

Generating CSV in Lightning Web Components (LWC) - A Step-by-Step Guide

Introduction: Lightning Web Components (LWC) is a powerful framework provided by Salesforce for building modern and efficient user interfaces in the Lightning Experience. In this blog, we will explore how to create a full-fledged LWC application that generates and exports data as a CSV (Comma-Separated Values) file. CSV files are commonly used for data exchange and can be opened and manipulated with various spreadsheet software.