2017-05-26 172 views

回答

0

如果你想在多選選擇所有值(當 「所有」 選中),你可以使用:

select: function(e) { 
    var dataItem = this.dataSource.view()[e.item.index()]; 

    var values = dataItem.value === "ALL" ? 
     $.map(this.dataSource.data(), function(dataItem) { 
      return dataItem.value; 
     }) 
     : this.value(); 

    this.value(values); // values holds all items within the multiselect 

} 

Dojo Example

相關問題