Two Columns Multi-Select Picklist Lightning Component
Note : From API Version 41.0 and later you can use lightning:dualListBox for the same.
for more information refer Lightning component developer guide
Two Columns multi-select is one of the frequently required functionality in web development. MultiselectPicklist is a Lightning Component developed for the same. It can be used easily in lightning components as well as in visualforce pages.
for more information refer Lightning component developer guide
Two Columns multi-select is one of the frequently required functionality in web development. MultiselectPicklist is a Lightning Component developed for the same. It can be used easily in lightning components as well as in visualforce pages.
Component Name:
MultiselectPicklist
Required
Attribute: name=availablePickList, type= String []
Usage:
-
In Lightning component / Lightning App :
Syntax :
<c:MultiselectPicklist availablePickList= List of picklist/>
Eg.
<c:MultiselectPicklist availablePickList="['spray', 'limit','elite', 'exuberant', 'destruction', 'present']"/>
-
In Visualforce Page :
To use this component in Visualforce page, create an App which extends ltng:outApp. Set Dependency In Lightning App. Refer TestApp
TestApp:
TestApp:
<aura:application access="global" extends="ltng:outApp">
<aura:dependency resource="c:MultiselectPicklist">
</aura:dependency></aura:application>
TwoColumnsMultiSelectVFpage:
<apex:page >
<apex:includeLightning />
<div id="multiselectDiv" />
<script>
$Lightning.use("c:TestApp", function() {
$Lightning.createComponent("c:MultiselectPicklist",
{availablePickList : ['spray', 'limit', 'elite', 'exuberant', 'destruction', 'present']},
'multiselectDiv',
function(cmp) {
console.log('component created successfully')
});
});
</script>
</apex:page>
You can download MultiselectPicklist lightning component from here.
How it looks:
lightning:dualListbox base component is already available for similar use case.
ReplyDeleteThanks Brahmaji. I was not aware of this component. Thanks for sharing.
Delete