ng-tasty
ng-tasty copied to clipboard
Resize columns
I think this control doesn't have one important feature. It's a resize columns.
Can you explain what you mean about resize columns? Change CSS
style?
Because you can do that inside the header
values
http://zizzamia.com/ng-tasty/directive/table/custom-sorting
check the javascript code, about the part of
"header": [
{ "key": "name", "name": "Name", "style": {"width": "50%"} },
{ "key": "star", "name": "Star", "style": {"width": "15%"} },
{ "key": "sf-location", "name": "SF Location", "style": {"width": "35%"} }
]
No, I know this feature. I mean when user can resize by grabbing the column borders and drag them. Like this one http://dobtco.github.io/jquery-resizable-columns @Zizzamia
I believe we could implement that just by pure CSS, without extra stuff on ngTasty. This table it's meant to be really tiny and flexible, so you can implement custom version easily.
Yes, I made it by myself. But, we need JS code to implement it. The main problem here all plugins works when th
tags are exists on the page. I have written custom directive:
.directive('tableResizable', ['$timeout',function ($timeout) {
function checkHeaderExist(element) {
$timeout(function () {
if($(element[0]).has('th').length > 0)
{
$(element[0]).resizableColumns();
}
else {
checkHeaderExist(element);
}
})
}
return {
restrict: 'A',
link: function (scope, element, attrs) {
checkHeaderExist(element);
}
}
}]);
But, I think resize is very important feature and has to be in every table. But, It's your component and you decide what is the best for it. I would implement it but I am very beginner in JS and angular.
Not sure resizable table need JS, should not be just need it CSS? I will take some time to do all the need it research.