angular-advanced-searchbox
angular-advanced-searchbox copied to clipboard
Is there any implementation for date properties?
It would be extremely helpful to be able to search by date properties via datetimepicker. Is this functionality already available?
Hi, this was also requested in #19 and is on my todo list.
Does the HTML 5 datetime picker work for your or do you need a plugin for older browsers?
When type="date" is supplied along with seacrhParameters, it displays the calendar. But, the issue is, if you click on down arrow in the text box that usually comes in date type input field, it trigger ng-blur event (this happens only first time and after that it behaves normally). This ng-blur event hides the calendar since it resets edit property from that particular element. Anyone elese faced this issue?

Hi,
thats the current and very annoying problem with ng-blur. Thats why this feature is not official. I've currently no good idea how to solve this.
One hack can be to keep a counter and check if input type is date and counter is 0, then don't make searchParam.editMode = false in $scope.leaveEditMode(). After that, it should be fine.
Hey, I was casually going through the code. I think this issue might be due to nitSetFocus directive. The problem is that, when you click to add any search parameter, the focus on that element is set in nitSetFocus directive. But after that, due to some reason focus is lost. This issue is coming on any type of HTML element. For example, if you add any text parameter, and instead of directly typing in the text box, you click inside the text box, the search parameter will get removed and you will have to select it again from list of available parameters. Even if this is expected behavior, would it be possible to not lose the focus on element when one clicks on the input element, so that date type can be added in search param.
Update. I was able to fix this issue by re-entering edit mode on click event inside the input element. ng-click="enterEditMode($event, $index)" Can you please verify that will fix this issue?
Hey @gargvaibhav90,
this is just a "hack" ;) .. The real problem is the ng-blur to leave the edit mode. The blur event is not very useful for that but i've currently no clue what else.
@dnauck, @gargvaibhav90 is there a downside to using the hack above as a stopgap solution to the ng-blur problems?
@gargvaibhav90 I had the same issue and i fixed with ng-click="enterEditMode($event, $index)" on input as you said.