jQWidgets Forums

jQuery UI Widgets Forums General Discussions adaptater autocomplete

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 9 years ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • adaptater autocomplete #84850

    runsense
    Participant

    hi,
    i try to implement autocomplete for
    external json array
    $(FS.tbid[1]).jqxInput({width:FS.larg-4,height:’auto’,
    source:function(query,response){
    var dataAdapter=new $.jqx.dataAdapter({
    localdata:FS.chargeCmpl(query),datatype:”array”
    },{
    autoBind:true,formatData:
    function(data){data.name_startsWith=query;return data;},
    loadComplete:function(data)FS.lent(data);
    },beforeLoadComplete:function(records){;}
    })}});
    & call
    chargeCmpl:function(query){data=[];for(var i=0;i<FS.tbval.length;i++){$.each(FS.tbval[i].tab,function(){var test=JSON.stringify(this).substring(6).split(‘”‘)[0].toLowerCase();if(test.search(query)!=-1){data.push(this);}});};return data;},
    need pass by JSON for have value like this..!!
    another way is an array..direct by this[0].
    & like this return results of search
    but start with second word!!!

    like ‘alicia keys’ just search on ‘key’.

    so..
    i write like this
    var dataAdapter=new $.jqx.dataAdapter({localdata:function(){data=[];return data;},datatype:”array”},{autoBind:true,formatData:function(data){data.name_startsWith=query;return data;},loadComplete:function(data){FS.ipcb(data);},beforeLoadComplete:function(records){;}})
    with
    ipcb:function(data){FS.msk=[];var val=$(FS.tbid[1]).val().substring(1).toLowerCase();var rw=[];$.each(FS.tbval,function(){if(this.id==FS.tableID){rw=this.tab;}});$.each(rw,function(){var cmp=this;if(this[0].search(val)!=-1){FS.msk.push([this[2]+”/_/”+this[0],this[1]]);}});FS.lent(FS.msk);},

    work fine fast & nice…
    but i don’t understand why don’t take directly.

    adaptater autocomplete #84851

    Peter Stoev
    Keymaster

    Hi runsense,

    You may look at: http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxinput/index.htm#demos/jqxinput/defaultfunctionality.htm to learn how to use and populate this widget with data.

    Best Regards,
    Peter Stoev

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

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

You must be logged in to reply to this topic.