I use angularjs ng-grid.
I want to add a button for expand/collapse all rows, when ng-grid group by some field. How can I do this?
The grouped part of ng-grid will probably have a class .ngViewport .ng-scope
This is where you want to add collapse functionality I guess.
Add this div a ng-show attribute dynamically
$('.ngViewport').attr('ng-show', 'collapsed'); //This is jquery, you can use angular directives for best practice, dont have time :)
Assign it to a button. So whenever you click, it will toggle.
Click here to <strong>Toggle (show/hide)</strong> Grid
Related
I need to change the Today, Clear and Close button's label. I'm looking for something like the clear-text, close-text and current-text options for the datepickerPopup directive or for a good alternative workaround.
Tried to change with Jquery, but the buttons don't have unique class or id, so I cannot create a unique selector for each button.
I am creating a custom angular directive to disable elements like input,anchor,button etc for a page containing kendo grids...
Directive works fine on other elements but not on kendo grids...few columns of the grid is having anchor tags need to disable them...
My question here is
How to apply custom logic present in my directive after kendo grid render completed...by emiting or broadcasting some action on databound event or etc...or by watching a rootscope value and changing it...
What would be the best approach i can take...will update the question soon with some codes...posting this from mobile...
I am new to angular, i am having requirement like create dynamically a dropdown with 3 buttons(add,edit,delete) by clicking on a link(create drop down button). We can create a multiple dropdown by clicking on a link Add/delete button should show with dropdown by default. If click on add/delete should display edit and viceversa.
See angularjs directives https://docs.angularjs.org/guide/directive
For dynamic handling of DOM directive is the best
You can also check https://angular-ui.github.io/ for more features make with directive
I have just started with angularjs. Just wanted to know that if it is possible to create a sub grid inside another ng-grid. There would be some links in a column of the grid and when I click a particular link a grid corresponding to that link should be formed inside the already existing grid.The original grid would be having say 5 columns while the new grid will have say 4 columns. So something on the lines of colspan or something similar is what I look for.
If you are open for writing Angular Directive then you can use any grid ,other than ng-grid which has subgrid feature.
I know like Kendo Grid has subgrid feature and jqgrid has subgrid feature. I wrote a Grid using Google Closure library , this also has subgrid feature.
If I understand your question, you need something like master/details inside grid, it not part of base functionality. nggrid has fixed row height, for virtual scrolling purpose. On our project we have created custom grid plugin base on nggrid
Solution that we used is:
write custom sort function, which populate duplicated rows always below main
when we click expand button we duplicate current row n-times depend on subgrid height
in main row we create css overlay container which hides duplicated rows
load overlay container content via ajax
When we click hide button, we hide overlay, and remove duplicated rows.
I'm trying to use the kendo ui grid and display a link column in an AngularJS application. The column is rendered using a template. I'm using the AngularJS ng-click directive in the template to call a method when the link in a cell is clicked. ng-click does not appear to work in a column template.
Here is an example.
However a similar example that DOES NOT use a column template seems to work fine with ng-click.
Any help is greatly appreciated!