- Timestamp:
- 03/05/14 22:44:48 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/src/client/qed-client/model/widgets/TabbedQuestionBrowser.js
r477 r487 1 1 define([ 2 'dojo/_base/declare', 3 'dojo/_base/lang', 4 'dojo/_base/window', 5 'dijit/layout/ContentPane', 6 'dijit/layout/TabContainer', 7 'dojox/widget/Standby', 8 '../../store', 9 '../../widgets/Selector' 10 ],function(declare,lang,win,ContentPane,TabContainer,Standby,store,Selector){ 2 "../../widgets/Selector", 3 "../classes/categories", 4 "../classes/questions", 5 "../classes/topics", 6 "dijit/layout/ContentPane", 7 "dijit/layout/TabContainer", 8 "dojo/_base/declare", 9 "dojo/_base/lang", 10 "dojo/_base/window", 11 "dojox/widget/Standby" 12 ], function(Selector, categories, questions, topics, ContentPane, TabContainer, declare, lang, win, Standby) { 11 13 return declare([TabContainer],{ 12 14 tabPosition: 'left-h', … … 38 40 this._fillCategoryTab(newTab.__category); 39 41 })); 40 store.query(this._query, {reduce:true,group:true,group_level:1})41 .for Pairs(lang.hitch(this,function(value,key){42 this._createCategoryTab( key[0],value);42 categories.query() 43 .forEach(lang.hitch(this,function(cat){ 44 this._createCategoryTab(cat.name,cat.count); 43 45 })); 44 46 }, … … 61 63 this._busy(); 62 64 categoryMap._filled = true; 63 store.query(this._query, {reduce:true,group:true,group_level:2,startkey:[category],endkey:[category,{}]})64 .for Pairs(lang.hitch(this,function(value,key){65 this._createTopicSelector( key[1],category,value);65 topics.query({category:category}) 66 .forEach(lang.hitch(this,function(topic){ 67 this._createTopicSelector(topic.name,category,topic.count); 66 68 })).then(lang.hitch(this,function(){ 67 69 this._done(); … … 101 103 topicMap._filled = true; 102 104 this._busy(); 103 store.query(this._query, { 104 reduce:false, 105 include_docs:true, 106 key:[category,topic] 107 }).forEach(lang.hitch(this,function(value){ 105 questions.query({category:category,topic:topic}) 106 .forEach(lang.hitch(this,function(value){ 108 107 topicMap._widget.addItem(value); 109 108 })).then(lang.hitch(this,function(){
Note: See TracChangeset
for help on using the changeset viewer.