Ticket #6021: ComboBox.js.patch

File ComboBox.js.patch, 1.3 kB (added by guest, 10 months ago)

ComboBox?.js patch to allow sorting of data store

  • ComboBox.js

     
    4141                //              before doing further filtering based on searchAttr and the key. 
    4242                query: {}, 
    4343 
     44                // sort: Object 
     45                //              A sort order that can be passed to the 'store' to sort the drop down. 
     46                sort: {}, 
     47 
    4448                // autoComplete: Boolean 
    4549                //              If you type in a partial string, and then tab out of the <input> box, 
    4650                //              automatically copy the first entry displayed in the drop down list to 
     
    489493                        // create a new query to prevent accidentally querying for a hidden value from FilteringSelect's keyField 
    490494                        var query=this.query; 
    491495                        this._lastQuery=query[this.searchAttr]=key+"*"; 
    492                         var dataObject=this.store.fetch({queryOptions:{ignoreCase:this.ignoreCase, deep:true}, query: query, onComplete:dojo.hitch(this, "_openResultList"), start:0, count:this.pageSize}); 
     496                        var dataObject=this.store.fetch({queryOptions:{ignoreCase:this.ignoreCase, deep:true}, query: query, sort: this.sort, onComplete:dojo.hitch(this, "_openResultList"), start:0, count:this.pageSize}); 
    493497                        function nextSearch(dataObject, direction){ 
    494498                                dataObject.start+=dataObject.count*direction; 
    495499                                // #4091: tell callback the direction of the paging so the screen reader knows which menu option to shout