-
Notifications
You must be signed in to change notification settings - Fork 7
Badge Docs Review #434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Badge Docs Review #434
Conversation
| # Badge | ||
|
|
||
| This is a component of Backendless [UI-Builder](https://backendless.com/developers/#ui-builder) designer. It generates a small badge to the corner of its child(ren). Any text, custom image or Material icon can be as a content of the component. It is also possible to combine them. | ||
| The Badge component allows displaying specific data in the corner of the selected image/icon. The data must be a number or a string value which is fetched from the database and projected up into the right corner. This component is available in the [UI-Builder](https://backendless.com/developers/#ui-builder). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The data must be a number or a string value which is fetched from the database and projected up into the right corner.
Are you sure in must here? I think it could be absolutely any value from anywhere, not just fetched from database.
| <img src="./example-images/component_badge_4.png" alt="settings" width="780"/> | ||
| </p> | ||
|
|
||
| To display a specific value in the corner of the badge, you must set the **Badge Label Logic** handler in the Codeless. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you must set the Badge Label Logic
But it could be setting too.
| <p align="center"> | ||
| <img src="./example-images/component_badge_1.png" alt="settings" width="780"/> | ||
| </p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need in this image. Your description is exhaustive.
| To display a specific value in the corner of the badge, you must set the **Badge Label Logic** handler in the Codeless. | ||
|
|
||
| <p align="center"> | ||
| <img src="./example-images/component_badge_1.png" alt="settings" width="780"/> | ||
| </p> | ||
|
|
||
| Suppose you have a data table where the number of unread messages is stored: | ||
|
|
||
| <p align="center"> | ||
| <img src="./example-images/component_badge_2.png" alt="settings" width="780"/> | ||
| </p> | ||
|
|
||
| To display the number of unread messages in the corner of your badge, you have to set the Logic that fetches the data from the table. The example below retrieves an object from the data table called **cloudMessages**, and then the value of the property **unreadMessages** is extracted from the object: | ||
|
|
||
| <p align="center"> | ||
| <img src="./example-images/component_badge_3.png" alt="settings" width="780"/> | ||
| </p> | ||
|
|
||
| As the result, once the page is loaded, the number of unread messages is displayed in the corner of the badge: | ||
|
|
||
| <p align="center"> | ||
| <img src="./example-images/component_badge_5.png" alt="settings" width="780"/> | ||
| </p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move to bottom. There should be an examples section.
|
|
||
| Then it is necessary to determine the contents of the component. Go to UI-Builder designer and specify one of the content field or combine them if you need. The component will be displayed with default properties. If you need even more flexibility, make other changes to its appearance in UI-Builder designer or by codeless logic. | ||
| <p align="center"> | ||
| <img src="./example-images/component_badge_4.png" alt="settings" width="780"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use meaningful image names
| To display the number of unread messages in the corner of your badge, you have to set the Logic that fetches the data from the table. The example below retrieves an object from the data table called **cloudMessages**, and then the value of the property **unreadMessages** is extracted from the object: | ||
|
|
||
| <p align="center"> | ||
| <img src="./example-images/component_badge_3.png" alt="settings" width="780"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I't very bad practice. This handler will run on every render and run a bunch of requests. Contact component creator to get right example for this case.
No description provided.