on 2020 Jan 23 4:47 AM
Hi,
I have a requirement to format date. For this I have written function in the parent class. Now how can I access parent function in the formatter ?
This is what I am trying but without success. This is piece of code of my Excel Export.
{
name: "Level1 Timestamp",
template: {
content: "{path: 'Level1Timestamp', formatter: 'BaseController.datTimeFormat'}"
}
BaseController (the file name and also the instance of parent class is BaseController) is the parent controller which has dateTimeFormat function.
I tried full path of Parent class but no luck. Both Parent class and the child class (where I am using formatter) are in the same View folder.
Request clarification before answering.
I'm not sure if there's a way to do this with the "string annotation". Worst case, you can write a delegate function in your controller.
datTimeFormat: function(){
this.prototype.datTimeFormat.apply(this, arguments);
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think there is way ....because, if I try to use another formatter function (which is in the util folder of my project with format file name) giving the absolute path (Application root followed by util folder and format file name) then it works.
But same if I try (I mean path) for my BaseController then it doesn't work. So looks like I am not following the correct syntax while providing the BaseController.js path.
Hello,
Did you simply try this :
formatter: '.datTimeFormat'
With the dot and then without the dot.
Regards,
Joseph
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.