javascript - Kendo Grid How to hide column in Angular scope function? -


i ask, how hide dynamically column in kendo grid in scope angular js function?

i tried using fiddle:

http://jsfiddle.net/onabai/xncmt/

but if i'm trying same function in angular scope function after ng-click:

$scope.hidecolumn = function () {             console.log("hidding");             grid.hidecolumn("user_role"); }; 

i error:

typeerror: undefined not function     @ scope.$scope.hidecolumn 

how can (not hidding, locking, etc..) ?

thans advice.

if have kendo grid name set kendo, can access $scope in controller.

e.g.

    <div id="someid" data-kendo-grid="accessmefromthecontrollerid"     k-auto-bind="false"      k-data-source-init={... removed brevity...}     k-columns="[         { field: 'id', title: 'id' },         { field: 'columntobehidden', title: 'i should hidden!' }        ]"     ></div> 

you can access controller , hide column using:

$scope.accessmefromthecontrollerid.hidecolumn('columntobehidden'); 

if want use jquery (not angular-ish can know)

$("#accessmefromthecontrollerid").data("kendogrid").hidecolumn('customername'); 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -