Skip to content

Instantly share code, notes, and snippets.

@jongpie
Created January 5, 2023 21:04
Show Gist options
  • Save jongpie/cdb5221eb7ee3508f5c642b9403d32dd to your computer and use it in GitHub Desktop.
Save jongpie/cdb5221eb7ee3508f5c642b9403d32dd to your computer and use it in GitHub Desktop.
Community Cloud list view component
<aura:component implements="forceCommunity:availableForAllPageTypes" access="global">
<!-- Attributes -->
<aura:attribute access="public" required="true" name="objectApiName" type="String" />
<aura:attribute access="public" required="true" name="listName" type="String" />
<aura:attribute access="public" required="true" name="rows" type="Integer" default="50" />
<aura:attribute access="public" required="false" name="showSearchBar" type="Boolean" default="false" />
<aura:attribute access="public" required="false" name="showActionBar" type="Boolean" default="false" />
<aura:attribute access="public" required="false" name="showRowLevelActions" type="Boolean" default="false" />
<aura:attribute access="public" required="false" name="enableInlineEdit" type="Boolean" default="false" />
<!-- Markup -->
<lightning:listView aura:id="listViewAccounts"
enableInlineEdit="{!v.enableInlineEdit}"
listName="{!v.listName}"
objectApiName="{!v.objectApiName}"
rows="{!v.rows}"
showActionBar="{!v.showActionBar}"
showRowLevelActions="{!v.showRowLevelActions}"
showSearchBar="{!v.showSearchBar}"
/>
</aura:component>
<?xml version="1.0" encoding="UTF-8"?>
<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>56.0</apiVersion>
</AuraDefinitionBundle>
<design:component label="List View">
<design:attribute required="true" name="objectApiName" label="Object API Name" />
<design:attribute required="true" name="listName" label="List View API Name" />
<design:attribute required="true" name="rows" label="Number of Records to Display" />
<design:attribute required="false" name="showSearchBar" label="Show Search Bar" />
<design:attribute required="false" name="showActionBar" label="Show Action Bar" />
<design:attribute required="false" name="showRowLevelActions" label="Show Row-Level Actions" />
<design:attribute required="false" name="enableInlineEdit" label="Enable Inline Edit" />
</design:component>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment