2012-10-29 75 views
1

我有一個關於DOJO小部件「dojox/mobile/_DataListMixin」的問題。 基本上,我的widget我的HTML定義,像這樣:DOJO 1.8移動小部件沒有在屏幕上顯示

<ul data-dojo-type="dojox.mobile._DataListMixin" id="meetingul"> </ul>

我的目標是把列表項部件在<ul>。我必須這樣做的JavaScript是這樣的。 `

require(["dojox/mobile/parser", 
    "dijit/registry", 
    "dojo/request", 
    "dojox/mobile/_DataListMixin", 
    "dojox/mobile/_DataMixin", 
    "dojo/_base/array", 
    "dojo/store/Memory", 
    "dojox/mobile", 
    "dojox/mobile/ScrollableView", 
    "dojox/mobile/DatePicker", 
    "dojox/mobile/Button", 
    "dojox/mobile/TabBar", 
    "dojox/mobile/compat" 
    ], 
function(parser, registry, request,DataListMixin,DataMixin,basearray,store) { 
    // Parse the page for widgets! 
    parser.parse(); 

    gotoToday = function(){ 
    registry.byId("dpw").reset(); 
     } 
showSelectedValue = function(){ 
     var w = registry.byId("dpw"); 
     //console.log(w); 
     var d = w.get("value"); 
// var d = w.slots[0].get("value")+ "-" + w.slots[1].get("value") + "-" + w.slots[2].get("value"); //gets same value as above line but "OCT" instead of 11 
     return d; 
    } 
    fillMeetings = function(){ 
     var date = registry.byId("dpw"); 
     var meetingdes = document.getElementById("meetingdescription"); 
     var meetingul = document.getElementById("meetingul"); 
     //registry.byId("meetings").innerHTML = showSelectedValue(); 
     var sqldate = {sqldate:showSelectedValue()}; 

     var deferred = request.post("resources/meetingsarray.php", 
      {data:sqldate, 
      handleAs: "json"}); 


     deferred.then(function(res){ 
      console.log(res); 
       var meetingul = registry.byId("meetingul"); 
       var meetingsview = registry.byId("meetings"); 
       var memstore = new store({data:res}); 
       var memdata = memstore.data; 
       console.log(memstore); 
       // datamixin.setStore(memstore); 

       onComplete:{ 
         meetingul = DataListMixin(DataMixin(memstore), request); 
          } 

     }, 
      function(error){ 
        console.log("An error occurred: " + error); 
       }); 
    } 
    }); 

     </script> ` 

memstore變量得到,我希望它以JSON格式正確的數據,但它不填充ul像我想它。沒有錯誤,我只是想我缺少一些基本的東西。如果您有任何建議,請回復,謝謝。

回答

0

我看不出這條線如何expectde工作

meetingul = DataListMixin(DataMixin(memstore), request); 

你是簡單的賦值給一個變量,這樣做會不會影響什麼在列表中。

我有這樣的代碼:

var meetingul = registry.byId("meetingul"); 

    var store = new Memory({ 
    data : mydata 
    }); 

    meetingul.setStore(store);