That worked for me, my issue was all the examples I found wasnt either updated or finished, and specifically there wasnt any properties being passed down to the real function, and the declarition of the real function wasnt setup to recieve any properties. So i looked to the source code and found a working example.
Orderby though i havnt found the correct declaration for, if you find a place its used in the backoffice its quite easy to find the implementation and take it from there.
Umb-table can't make any events fire
Hey there :)
Im doing a custom section where I have an umb-table with some custom data. It gets rendered just fine, but in no way can I get any events to work.
Latest umbraco 8.1.1 and my controller and view looks like this: View:
Controller:
No issues in the console or nothing, and the custom data gets populated.
Hi Rasmus.
All seems find to me. Maybe this could be the issue, but I doubt it.
You have not defined allSelectAll in your controller.
And maybe remove the ng-if. I seen this having some side effects.
Dave
Ive tried removing the ng-if aswell, nothing.
I know its not set in the controller, ive just been leaning against this documentation for the umb-table:
https://our.umbraco.com/apidocs/v8/ui/#/api/umbraco.directives.directive:umbTable
Where its not set aswell.
I figured it out, apperantly it has changed to V8 or somewhere in between. Took notice of this use here:
https://github.com/umbraco/Umbraco-CMS/blob/e180bb672212332556ac8ac17573a42c6311ba27/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/layouts/list/list.listviewlayout.controller.js
and here
https://github.com/umbraco/Umbraco-CMS/blob/853087a75044b814df458457dc9a1f778cc89749/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/layouts/list/list.html
So put this together as functions:
And this as view
works now :)
Hi Rasmus,
What is your umbraco version?
For Me, it's not working on Umbraco 8.1.1 ... It is showing this error :
Can you help me or post your full code?
my answer is here: https://our.umbraco.com/forum/umbraco-8/98497-umb-table-cant-make-any-events-fire#310808
Hi, little late but I had this problem myself.
Check out this controller: It contains options and other properties/functions that you can use.
https://github.com/umbraco/Umbraco-CMS/blob/853087a75044b814df458457dc9a1f778cc89749/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js
This is my example code:
Hi Rasmus, thanks to you i almost got it working now.
But i am using it in a custom section dashboard view and i am wondering what
$scope.selection
and$scope.options
is containing. Do you know?Because both are undefined as i do not have a listView as parent.
The documentation could use an update https://our.umbraco.com/apidocs/v8/ui/#/api/umbraco.directives.directive:umbTable ;)
Stupid me, i could just read the post above. lol.
Now i just need to actuelly figure out how to make the sorting happening.
Good to know :)
Hey :)
Actually my post just upabove works.
https://our.umbraco.com/forum/umbraco-8/98497-umb-table-cant-make-any-events-fire#comment-310404
That worked for me, my issue was all the examples I found wasnt either updated or finished, and specifically there wasnt any properties being passed down to the real function, and the declarition of the real function wasnt setup to recieve any properties. So i looked to the source code and found a working example.
Orderby though i havnt found the correct declaration for, if you find a place its used in the backoffice its quite easy to find the implementation and take it from there.
Hi Rasmus.
You should use () after function names in events input in View file.
For example in on-click event input, use vm.clickItem() instead of vm.clickItem.
Hi All,
Just re-enfosing Hassan's response. I noted most people's controller code was correct.
The thing that fixed it for me is simple adding those () on the end of the method calls innth ehtml view.
So...
vm.selectAll() vm.isSelectedAll()
Instead of
vm.selectAll vm.isSelectedAll
is working on a reply...