mcasimir / mobile-angular-ui

Angular.js Mobile UI Framework with Bootstrap 3
http://mobileangularui.com/
MIT License
2.87k stars 709 forks source link

autocomplete not available #242

Closed poojacmore closed 9 years ago

poojacmore commented 9 years ago

Is there is any possible way to implement autocomplete with mobile angular ui? Like jQuery

RemcovandenBerg commented 9 years ago

Mobile-angular-ui does not provide such component/directive at the moment. AngularJS is extensible by design, so you could drop in a specialized directive created for those purposes. Have look at https://github.com/JustGoscha/allmighty-autocomplete

poojacmore commented 9 years ago

Thank you so much for this hint. I will surely implement in this way.

You solved my problem.

Regards, Pooja

poojacmore commented 9 years ago

Hi RemcovandenBerg, I want to use autocomplete functionality with the entity fetched from the database. This is something I am trying to implement. I am using REST API,

$scope.autcomplete = function(typedthings) {
var scrollItems1 = []; var newItems =[];

$http.get('/structr/rest/study/default').success(function(data, status, headers, config) { scrollItems1 = data.result.map(function(study1) { return study1.Domain; }); console.log(scrollItems1); $scope.scoll = scrollItems1; newItems = scrollItems1(typedthings); newItems.then(function(data){ $scope.scoll = data; }); }). error(function(data, status, headers, config) { console.log(data, status, headers, config); }); };

I am calling this on on-type event Its throwing lots of errors. Can you please check where I am making mistake.. It will be a great help.

Regards, Pooja

RemcovandenBerg commented 9 years ago

It should be as simple as:

<autocomplete ng-model="yourchoice" data="autoCompleteChoices" on-type="autcomplete"></autocomplete>

$scope.autoCompleteChoices = [];

$scope.autcomplete = function(typedthings) {

    $http.get('/structr/rest/study/default')
    .success(function(data, status, headers, config){

            $scope.autoCompleteChoices = data.result.map(function(study1) {
              return study1.Domain;
            });

    })
    .error(function(data, status, headers, config) {
        console.log(data, status, headers, config);
    });
};

But I have not tested it, nor am I an expert or did I ever use this component. If you have further questions about it's usage, I think it is best to ask them on at the autocomplete project itself on Github.

poojacmore commented 9 years ago

Hey thanks a lot.. I made it very complicated actually.. Your code worked, but just a small problem now.. I hope you can help me, and sorry as I am giving you trouble. It is shifting the screen down when the list is loaded on page, autocomplete Can you help with this please?

Regards, Pooja

RemcovandenBerg commented 9 years ago

Check your z-index, in the css of this component. It is set to 1 which should exclude it from the main. Maybe you have forgotten to add autocomplete.css

poojacmore commented 9 years ago

Hi Remco, I have added autocomplete.css at correct path still getting that behavior.

Regards, Pooja

On Thu, Apr 9, 2015 at 10:51 PM, Remco notifications@github.com wrote:

Check your z-index, in the css of this component. It is set to 1 which should exclude it from the main. Maybe you forgot to add autocomplete.css

— Reply to this email directly or view it on GitHub https://github.com/mcasimir/mobile-angular-ui/issues/242#issuecomment-91353207 .

RemcovandenBerg commented 9 years ago

Did you try increasing it's value? You can do this in your own css file by overriding the css style like this:

body .autocomplete ul{
    z-index: 3000;
}
poojacmore commented 9 years ago

Hi Remco, I changed the z-index in autocomplete.css where it was 1 before to 3000 and added 3000 in demo.css as well. Still getting the same result.

Do you have any idea what can be the cause?

Regards, Pooja

On Thu, Apr 9, 2015 at 11:01 PM, Remco notifications@github.com wrote:

Did you try increasing it's value? You can do this in your own css file by overriding the css style like this:

body .autocomplete ul{ z-index: 3000; }

— Reply to this email directly or view it on GitHub https://github.com/mcasimir/mobile-angular-ui/issues/242#issuecomment-91355253 .

RemcovandenBerg commented 9 years ago

Try reading up on the subject of css layers / z-index and positioning. http://www.loginradius.com/engineering/simple-popup-tutorial

poojacmore commented 9 years ago

Hey Remco, Thanks a lot :) for your hints.. :) It worked..

Thank you so much

Regards, Pooja

On Thu, Apr 9, 2015 at 11:17 PM, Remco notifications@github.com wrote:

Try reading up on the subject of css layers / z-index and positioning. http://www.echoecho.com/csslayers.htm

— Reply to this email directly or view it on GitHub https://github.com/mcasimir/mobile-angular-ui/issues/242#issuecomment-91358116 .