Multi select dropdown UI issue
I have beent trying to create a multi select dropdown inside ui-grid. The easiest way i could find is to modify the template of 'ui-grid/dropdownEditor' that ui-grid uses. There is an option of specifying 'multiple' in
This works but the dropdown options are not overlaying over the cell but it is hiding behind. top two options are visible but last option is hiding behind. What can i do to bring it to front. I know there should be a small fix in css. probably overflow: visible of some css class. but i could not find it. can somebody help? Double click on 'Gender' column in the plunker: http://plnkr.co/edit/ioCqCpnwpkk5A6K7dnoh?p=preview
@himsraw You could set a max-height on your <select> which would let it scroll.
I'm not sure you have other options with a raw html element. There are lots of other angular-based multi-select widgets out there, though.
@c0bra I was exploring other angularjs multiselect options and i came across http://ngmodules.org/modules/angularjs-dropdown-multiselect Trying to fit this into ui-grid cell but still not successful. If anyone has implemented any multiselect control inside ui-grid help would be highly appreciated.
The issue is the cell is set to overflow: hidden. This is expected for read only cells but possibly not for edit mode? A quick fix is to simply set position: absolute on the multiselect div.
@himsraw also would like this feature.
As you can see the dropdown doesn't work inside the filter section. Anyone know a decent workaround?
http://plnkr.co/edit/rtUZ2nY39Bu7GUQZmuDw?p=preview
+1
+1
@billyaraujo stuck with same problem. Did you get any solution to implement a multi select dropdown as a column filter? Thx
@meenakshijha no. The only thing I can think of is putting the filter outside the grid but that is not the most elegant solution.
@billyaraujo Thanks for responding. And yes outside the grid won't solve the purpose. I am trying to add , but my drop down gets hidden behind the grid header. Not sure how to view the complete options!
+1
Far from elegant, but here's something: http://plnkr.co/edit/MLT02DpcwoL0AK2QClow?p=preview
Just added:
.ui-grid-header-viewport { overflow:visible !important; }
.ui-grid-top-panel { overflow:visible !important; }

Initial question is answered here, http://plnkr.co/edit/Re7E7y38M2WpkzAJyL5p?p=preview
Anyone know the worked solution for multiselect filtering?
+1
Buy the way, if actual. I found the working solution. It's very easy :)
- in $scope.gridOptions.columnDefs column property adding the next
$scope.gridOptions.columnDefs = [
{ name: 'id'},
{ name: 'name',
width: 220,
filterHeaderTemplate: '<div class="ui-grid-filter-container" ng-repeat="colFilter in col.filters"><filter-directive></filter-directive></div>',
},
- add html file with multiselect implementation custom-grid-filter.html with controller nameCtrl
<div ng-controller = "nameCtrl">
<multi-select
input-model="names"
button-label="name"
item-label="name"
tick-property="ticked"
max-labels="1"
helper-elements=""
on-item-click="fClick( data )"
default-label="None"
class="level-multi-select">
</multi-select>
</div>
- add controller nameCtrl and directive filter-directive for this filter
//custom filtering implementation
.controller('nameCtrl', function ($scope, $rootScope) {
$scope.names = [
{name: "Terry Clay", ticked:false}
,{name: "Marci Gill", ticked:false}
,{name: "Annie Orr", ticked:false}
];
$scope.fClick = function(data) {
var selectedNames = _.pluck(_.filter($scope.names, "ticked"), "name");
if(!selectedNames.length)
$scope.grid.appScope.gridOptions.data = $scope.grid.appScope.originalData;
else
$scope.grid.appScope.gridOptions.data = _.filter( $scope.grid.appScope.originalData, function (item) {
return _.contains(selectedNames, item.name) ;
});
};
})
.directive('filterDirective', function() {
return {
restrict: 'E',
templateUrl: 'custom-grid-filter.html'
};
})
//end custom filtering implementation
Thats it. Buy the way, by this solution You can implement any filtering You want. Sorry, I have no time to put some example to the punker, but I hope My solution more/less understainable. Greetings from Ukraine!
@c0bra do u have the fix for the multi-select ui issue?
Actually, it's not a fix. It's simple solution by adding directive to the grid template. See My decription above.
@Olegarius thx for the response..Actually i am asking about the edit issue in the last row of the grid.
Sorry, not tryed. But I think it must work for edit rows to.
@Olegarius Where <multi-select> directive is defined?