jQuery UI Widgets Forums Angular JqxInput [ object Object ] error

Tagged: 

This topic contains 4 replies, has 3 voices, and was last updated by  andrea 2 years, 9 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • JqxInput [ object Object ] error #96756

    andrea
    Participant

    Hi,

    On your page under Angular 4 UI Components > jqxInput > Binding to JSON Data > Demo tab there is an error which I also have on my application. Here is the case:

    I type ‘Ana’ and I select the value from the auto suggest list. The selected value ‘Ana Trujillo’ is displayed on the input correctly. Next I use the backspace button to clean the jqxinput from the selected value. When jqxinput is clean, I try to enter a new value but whatever character I type the jqxinput component displays this value inside [object Object].

    How can I resolve this issue please?

    JqxInput [ object Object ] error #96768

    Peter Stoev
    Keymaster

    Hi andrea.p,

    You can workaround that issue by detecting the text in the INPUT and then updating it again manually via a val method call.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    https://www.jqwidgets.com/

    JqxInput [ object Object ] error #96782

    andrea
    Participant

    I have tried with ngModelChange event but the input contains the correct value I enter. I can’t detect any [object Object] value in order to override it. Please provide me with a specific example.

    JqxInput [ object Object ] error #96806

    Ivo Zhulev
    Participant

    Hi andrea.p,

    This will be fine in the next release. For now, go to the angular_jqxinput.ts file and change the method get ngValue() to:

    get ngValue(): any {
           if (this.widgetObject) {
               const value = this.host.val();
               if(typeof value === 'object')
                   return value.label;
               return value; 
           }
           return '';
       }

    Best Regards,
    Ivo

    jQWidgets Team
    http://www.jqwidgets.com/

    JqxInput [ object Object ] error #96827

    andrea
    Participant

    What worked for me was this code:

    
    get ngValue(): any {
           if (this.widgetObject) {
               const value = this.host.val();
               if(typeof value === 'object'){
                   return '';
               }
               return value; 
           }
           return '';
       }
    

    Thanks for the guide.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.