I want to insert date-picker in headercelltemplate to filter the date column in custom filter in ng- grid

681 views
Skip to first unread message

Thrinadh Vagicharla

unread,
Dec 23, 2014, 1:53:24 AM12/23/14
to ang...@googlegroups.com
Hi 
Thanks for looking in to my issue.
I placed a custom filter in my angularjs grid in that i have  a column date so i want to filter that column with datepicker. So i placed a headercelltemplete i placed 
<input type="text" datepicker-popup="dd-MMM-yyyy" ng-click="open($event)" placeholder="{{col.displayName}}"
       ng-model="col.filterText" is-open="opened" max="today" name="date"
       datepicker-options="dateOptions" date-disabled="disabled(date, mode)"
       close-text="Close" ng-style="{ 'width' : col.width - 14 + 'px' }" style="position: absolute; top: 30px; bottom: 30px; left: 0; bottom:0;" />

inside headercelltemplete but i am not getting the datepicker please suggest me & help me to get the output as i expected.
Thanks in Advance
Regards 
Thrinadh 

Tobias Wolff

unread,
Dec 26, 2014, 3:23:02 PM12/26/14
to ang...@googlegroups.com
Hi Thrinadh,

can you post your definition of the "open()" function? My first guess is that you do not set the scope variable "opened" to "true" as only this will show the date picker.

Tobias.

Thrinadh Vagicharla

unread,
Dec 26, 2014, 11:57:57 PM12/26/14
to ang...@googlegroups.com
Hi Thanks for the reply.
My definition for open() is
 $scope.open = function ($event) {
            debugger;
            $event.preventDefault();
            $event.stopPropagation();

            $scope.opened = true;
        }
i assigned that to true but not getting datepicker.
Please suggest me


Thanks and Regards,

THRINADH VAGICHERLA
Mobile: +91-8050 03 8050  
           +91 868 66 66 309

--
You received this message because you are subscribed to a topic in the Google Groups "AngularJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angular/2z76IWsZnQQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

svg nle

unread,
Feb 24, 2015, 4:14:56 AM2/24/15
to ang...@googlegroups.com
Your current scope is not root scope. So you have to write  like that:

<button type="button" class="btn btn-default" ng-click="grid.appScope.open($event)"/>

23 Aralık 2014 Salı 08:53:24 UTC+2 tarihinde Thrinadh Vagicharla yazdı:
Reply all
Reply to author
Forward
0 new messages