Skip to content

Commit e486a48

Browse files
authored
enhanced readme #11
1 parent a5f4a21 commit e486a48

File tree

1 file changed

+21
-15
lines changed

1 file changed

+21
-15
lines changed

README.md

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
## About
88

9+
To deploy the component see [Deploy](#deploy)
10+
911
This is generic lighting data table , which is build in lwc.
1012
The customization are done by design attributes.
1113

@@ -16,7 +18,7 @@ The data table has following features.
1618
- Pagination as First,Previous,Next,Last buttons.
1719
- New record creation action
1820
- Row action, like : show detail, edit record, delete record
19-
- configurable buttons (for developers, see "Buttons configuration")
21+
- configurable buttons (for developers, see [Buttons configuration](#buttons-configuration-for-developers-accessible-in-the-component-and-from-parent-component) )
2022

2123
## Steps to Customization through Design Attribute
2224

@@ -27,13 +29,13 @@ Design Attribute
2729

2830
| Label | Required | Type | Value | Example |
2931
|-----------------|------------|------------|------------------------------|---------------------|
30-
| Enter Icon Name | false | String | provide slds icon name | `standard:account` |
31-
| Enter Title | true | String | provide table title | LWC Table |
32-
| Enter Object API Name | true | String| provide object custom or standard API name| Account |
33-
| Enter Columns JSON | true | String | { `fieldName`:api name,`label`:col label,`type`:text,number,date }. **Note** : for related field it should be concat with . i.e : Account.Name for contact | See below **Column JSON Example**
34-
Enter Related field API Name | false | String | Enter related field api name | Example AccountId for contact when component is on account layout.
35-
Enter WHERE clause | false | String | provide aditional filters | Example `LastName like '%s' AND Account.Name like '%t'`
36-
| Show the number of record | false | Boolean | append the number of records in the title | checked(true) OR not checked(false) |
32+
| Enter Icon Name | :x: | String | provide slds icon name | `standard:account` |
33+
| Enter Title | :heavy_check_mark: | String | provide table title | LWC Table |
34+
| Enter Object API Name | :heavy_check_mark: | String| provide object custom or standard API name| Account |
35+
| Enter Columns JSON | :heavy_check_mark: | String | { `fieldName`:api name,`label`:col label,`type`:text,number,date }. **Note** : for related field it should be concat with . i.e : Account.Name for contact | See below **Column JSON Example**
36+
Enter Related field API Name | :x: | String | Enter related field api name | Example AccountId for contact when component is on account layout.
37+
Enter WHERE clause | :x: | String | provide aditional filters | Example `LastName like '%s' AND Account.Name like '%t'`
38+
| Show the number of record | :x: | Boolean | append the number of records in the title | checked(true) OR not checked(false) |
3739

3840
## Columns JSON Example
3941
``` yaml
@@ -62,14 +64,16 @@ Enter WHERE clause | false | String | provide aditional filters | Example `LastN
6264
## Buttons configuration (for developers, accessible in the component and from parent component)
6365

6466
### Call apex or javascript method
65-
callApexFromButton must be true
67+
For a button that is going to call callApexFromButton, the properties must be :
68+
- callApexFromButton: true
6669

6770
### Fire event to parent component
68-
- callApex must be false
69-
- needSelectedRows can be true if you need to send selected rows to parent component
71+
For a button that is going to fire an event, the properties must be :
72+
- callApex: false
73+
- needSelectedRows : can be true if you need to send selected rows to parent component
7074

7175
### Example
72-
JSON :
76+
Javascript array (actionButtonsList property) :
7377
```
7478
[
7579
{ label : "delete all", variant: "destructive", needSelectedRows: true, callApex: true },
@@ -96,11 +100,13 @@ helloWorld(event) {
96100
}
97101
```
98102

99-
The first button "delete all" is not going to send event to parent it will call the javascript method callApexFromButton you must
103+
- The first button "delete all" is not going to send event to parent it will call the javascript method callApexFromButton you must
100104
implement the desired javascript/apex call based on the button label.
105+
- The button "action button" fires the event action2
106+
- The button "another action button" fires the event action3
101107

102-
The button "action button" fires the event action2
103-
The button "another action button" fires the event action3
108+
The results should be :
109+
![Capture buttons](https://user-images.githubusercontent.com/39730173/158386203-bca7099f-0070-48d2-8ec9-6936a68dd754.PNG)
104110

105111
## Deploy
106112
Click Button to deploy source in Developer/Sandbox

0 commit comments

Comments
 (0)