Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
40
Get other json data values
posted

So, in jQuery's autocomplete you are able to do something like this:

    $("input#loc").autocomplete({
        source: "mylocations.php",
        minLength: 3,
        select: function( event, ui) {
            $('#loc').val(ui.item.label);
            $('#bldg').val(ui.item.bldg);
            //autocomplete bldg
            loadRooms();
        }
    });

Is there any way to get additional data elements returned with the json?  If not, how does one even get the selectedValue?  Thanks!

Parents
  • 3595
    posted

    Hello Jodi,

    Thank you for posting in our community!

    I have several questions before investigating further: Could you clarify which Ignite UI control you are using?

    If your scenario does not include Ignite UI controls but jQuery widgets only I could redirect you to the jQuery autocomplete widget API:

    http://api.jqueryui.com/autocomplete/

    To the Ignite UI editor controls – the igEditor and igTextEditor for instance have a few methods for getting the selection:

    • getSelectedListItem:

    var item = $(".selector").igEditor("getSelectedListItem");

    • getSelectedText:

    var text = $(".selector").igEditor("getSelectedText");

    • getSelection:

    $(".selector").igEditor("getSelection",true);

    You might find more detailed information in the “METHODS” section of the following resource: http://help.infragistics.com/jQuery/2013.2/ui.igeditor

    In order to understand better your scenario could you give more information on what data elements exactly are returned with the json? A more detailed sample would be appreciated.

    Looking forwards to hearing from you.

     

Reply Children