Giter Site home page Giter Site logo

Comments (8)

ghiden avatar ghiden commented on June 13, 2024

Could you create a jsbin or plnkr example?
It works fine as you can see in the example page.
http://ghiden.github.io/angucomplete-alt/
For example 1, you select a country and then the result shows up below the input field.
Then, if you delete a character, the result disappears.
Isn't that what you see?

from angucomplete-alt.

Trish00 avatar Trish00 commented on June 13, 2024

Hi,  
Thanks for the reply.   
No, when I delete the selected value my model still displays the selected value even though I have cleared out the autocomplete field.  
At the moment I can't do plunker as it is blocked at my work so here is the relevant code.     

<div data-ng-controller="template-controller" >       
    <div class="form-inline" data-ng-repeat="item in tdata.fields">           
        <div class="row-top-margin" data-ng-controller="template-item-controller" style="padding-bottom: 5px;">                    

        <div angucomlete-alt id = "{{ item.Field.Value }}{{ $ index }}"                         
                data-ng-show="types.code"

                   data-ng-change="codeChange()"  // Does not get called. 
                    placeholder="{{ item.Field.Description }}"
                    pause="300"
                    selected-object="selectCallback"  
                   remote-url= "@Url.Action("GetReferenceData", "Search")?field={{ item.Field.Value }}&reference={{ item.Field.Reference }}"                        
title-field="Description"
                    min-length="2"
                    initial-value="{{ item.Description }}"
                   input-class="form-control form-control-small"
                    auto-match="true"
                    match-class="highlight">
            
            {{ item.CodeValue.Value }} / {{ item.Description }}    (This does not change when I delete the value)           

    
 

    For the selected-object callback.  Is only called when I select an item from the list  

$scope.selectCallback = function (result) {
        if (result != null) {
            $scope.item.CodeValue = result.originalObject;
            $scope.item.Description = result.originalObject.Description;
         }
         else {
         { 
             $scope.item.CodeValue = null;
              $scope.item.Description = "";
         }
     }; 

Thanks 

Trish   

from angucomplete-alt.

ghiden avatar ghiden commented on June 13, 2024

It looks quite legit to me.
But you have ng-repeat and in each repeated block, you have a controller, then angucomplete-alt.
I hope you are not messing around with scope.
ngChange won't affect anything for sure as there is no model.

Maybe if you can create a quick demo at jsbin or plnkr from your home, that might help me understand what's going on.

from angucomplete-alt.

ghiden avatar ghiden commented on June 13, 2024

I believe that you @Trish00 have resolved the issue so I'm closing this now.

from angucomplete-alt.

thrinay avatar thrinay commented on June 13, 2024

May I please know how this issue is resolved? Because at the moment am facing the same issue. Whenever am clearing an input field and making a post request I can see that there is no change being reflected and it keeps the same value as before without updating empty strings.

from angucomplete-alt.

vishalsahni avatar vishalsahni commented on June 13, 2024

I also need the solution related to this issue.

Please send it at my email id .

from angucomplete-alt.

thrinay avatar thrinay commented on June 13, 2024

You can attach a callback function to selected-object and you can manipulate the changes in that function. I have done that and it resolved my problem

from angucomplete-alt.

peidong-hu avatar peidong-hu commented on June 13, 2024

I am using the selected-object callback, but the parameter 'selected' is always 'undefined' if user doesn't select a value from the dropdown list on UI.

How can I know if the user set the value as empty on UI in autocomplete-alt?

from angucomplete-alt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.