on 04-06-2016 11:25 AM
Hi,
I am experimenting with formatter function.
view.xml:
Controller.xml
How can I write the formatter function to show the status based upon experience. For example, experience=2 then Error, experience =4 then success like that.
What is the syntax I have to include in view.xml to call formatter function and where should I place formatter.js in the below project structure:
Thanks and Regards,
Teja.
Hi Teja,
Follow below 4 steps to use formatter -
1. Add formatter file in folder structure-
2. Use it in View
3. Associate it in controller
4. Write code for formatter function -
PS: Here i have bound the enabled property of toggle button using formatter which enables/disables the button based on conditions.
Let us know if you need more help.
BR.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
1. Create the formatter.js file in objectnumber folder.
2. Reference the same in MyObjectNumber.controller.js specifying the full path. ( "<path>/objectnumber/formatter")
3. use in view as -
enabled="{parts: [{path:'processObjectModel>IsReadOnly'}, {path:'processObjectModel>SizeRelevant'}] , formatter : '.formatter.<name_of_formatter_function>'}"
If its still not clear, please paste view and controller code.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.