Code Monkey home page Code Monkey logo

slds-dynamic-lookup-component's Introduction

SLDS-Dynamic-Lookup-Component

A package with a component that can be easily used to create lookup fields on VF page using Salesforce Lightning Design System(SLDS)

Author Lakshay Katney

Setup

  1. This repo is ready to deploy package in any Salesforce organization. Use any metadata tool to deploy it
  2. There is an unmanaged version of this package too. Use below links to install it
    Sandbox Production/Developer

Usage

On VF page, just add a static resource and component with appropriare attributes

Static Resource

<apex:includeScript value="{!$Resource.SLDSDynamicLookupScript}"/>

Component Usage

<c:SLDSDynamicLookup SLDSResourceName="{!$Resource.SLDS}" ObjectApiName="User" DisplayFieldApiNames="Username,Name" DisplayFieldsPattern="Name - Username"  photo="field->smallPhotoUrl" LabelName="Set User" SetValueToField="{!con.OwnerId}"/>

Attributes Usage

Attribute Requirement Description
SLDSResourceName Required Attribute in which name of your static resource to be passed which contains Salesforce Lightning Design System(SLDS)
ObjectApiName Required Api name of component on which search should happen.
DisplayFieldApiNames Required Attribute to get fields Api Names whose value needs to be displayed while searching. These are seperated by comma. For example : 'firstname,lastname'
LabelName Required Attribute to display label along with custom lookup field made by this component
SetValueToField Required Attribute that will tell where to put selected value. Also populates the default value if field has value.
DisplayFieldsPattern Optional Attribute to get pattern to display value.You can combine two fields with pattern. For example : 'firstname - lastname'. By default it will take pattern as comma seperated fields
photo Optional Attribute that will tell if photo needs to be added to records while searching. For fields to be used, pattern should be 'field->fieldAPiName'. For url, pattern should be 'url->pathofimage'
FilterOn Optional Attribute that will filter the list of records in results
RenderOnComplete Optional Attribute that will run an action function/javascript on complete

Screenshots

Demo
Demo
Demo
Demo

Versions

Version 1.4

Introduction of dependent lookups
Allow filters on lookups on basis of parent lookup

Version 1.3

Improvements

Allow default values to show if passed

Version 1.2

First version to add lookup fields in SLDS styling on Visual force pages

slds-dynamic-lookup-component's People

Contributors

lkatney avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.