anbauer / ngx-lightning Goto Github PK
View Code? Open in Web Editor NEWA angular-cli based version of ng-lightning. Supports angular >= 6
License: MIT License
A angular-cli based version of ng-lightning. Supports angular >= 6
License: MIT License
When I set default value of PickList, it does not show check mark as if I would manually select a value. Is there a way to solve this problem?
component.html
<ngl-picklist nglFormControl
filter="label"
[data]="data"
[(nglPick)]="selected"
[(open)]="open"
[nglPickMultiple]="multiple">
<span class="slds-truncate">{{getPickLabel()}}</span>
<ng-template nglPicklistItem let-item>{{item.label}}</ng-template>
</ngl-picklist>
component.ts
selected = {label: 'Tier 1', value: 1};
data = [
{label: 'All tiers', value: null},
{label: 'Tier 1', value: 1},
{label: 'Tier 2', value: 2},
{label: 'Tier 3', value: 3}
]
Hi @AnBauer :)
There are already new releases on the original repo (https://github.com/ng-lightning/ng-lightning) that solve the issues for which this fork was created, plus new many components, new features, better infrastructure etc. Although I understand and I would like to thank you, i suggest that you deprecate this repo and npm package, so people will not be confused in the future as what is the best option to use.
In PickList component, how I initialize selected options ?
Hi there,
First of all, thank you very much for your work on this @AnBauer
I was wondering if you could give me some lights, I'm struggling a fair bit to have a Lookup component return me the value on the pickChange() callback.
My html is the following:
<div>
<ngl-lookup [lookup]="lookupAsync" field="userPrincipalName" [(pick)]="user" (pickChange)="pickChange($value)" debounce=400 >
<ng-template nglLookupLabel>User</ng-template>
<div nglLookupHeader class="slds-text-body--small">Users found:</div>
<ng-template nglLookupItem let-ctx>
<div class="slds-media__body">
<div class="slds-lookup__result-text">{{ctx.displayName}}</div>
<span class="slds-lookup__result-meta slds-text-body--small">UPN: {{ctx.userPrincipalName}}</span>
</div>
</ng-template>
</ngl-lookup>
</div>
The input array objects have 3 properties: id, displayName and userPrincipalName.
When I search for something, the lookup is working, I able to pick a user/result and everything is looking good.
Now I wanted to get the value back on my .component.ts and I did this test function:
pickChange(value: any) {
console.log(value);
}
However it returns "undefined" always.
I've looked at ng-lightning documentation and your code but I just can't figure out why that is.
Could you help me?
Thank you,
Ralms
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.