user3620627
user3620627

Reputation: 39

trNgGrid - show/hide column

http://moonstorm.github.io/trNgGrid/release/#/GlobalOptions?theme=simplex

Hi,

I have question. I want to use trNgGrid v3.0.5 RC and my Json has a lot of data.

I want show and hide column after click a checked box.

On documentation site when I unmark "Autodetect (fields = null or not set)" checked box I can see 3 checked boxes by means of I can hide on show column.

Please tell me how I can implement it, becouse my angular knowledge is weak.

After document ready several check boxes must be checked and rest of them should be unchecked.

i don't know how I can achieve it

Thanks

Upvotes: 1

Views: 676

Answers (1)

Uluk Biy
Uluk Biy

Reputation: 49215

you can use fields attribute of trNgGrid.

    <table 
       tr-ng-grid=''
       fields='show_fields'
       items='myItems'>
    </table>

in controller

$scope.show_fields = ['column1', 'column2'];

See this example.

Upvotes: 4

Related Questions