[Common] ComboDataView: add groups for DataView, refactoring item template
This commit is contained in:
parent
b304b01e9b
commit
b217759f82
|
@ -81,6 +81,7 @@ define([
|
||||||
this.style = this.options.style;
|
this.style = this.options.style;
|
||||||
this.hint = this.options.hint;
|
this.hint = this.options.hint;
|
||||||
this.store = this.options.store || new Common.UI.DataViewStore();
|
this.store = this.options.store || new Common.UI.DataViewStore();
|
||||||
|
this.groups = this.options.groups;
|
||||||
this.itemWidth = this.options.itemWidth;
|
this.itemWidth = this.options.itemWidth;
|
||||||
this.itemHeight = this.options.itemHeight;
|
this.itemHeight = this.options.itemHeight;
|
||||||
this.menuMaxHeight = this.options.menuMaxHeight;
|
this.menuMaxHeight = this.options.menuMaxHeight;
|
||||||
|
@ -92,18 +93,19 @@ define([
|
||||||
this.needFillComboView = false;
|
this.needFillComboView = false;
|
||||||
this.minWidth = this.options.minWidth;
|
this.minWidth = this.options.minWidth;
|
||||||
this.delayRenderTips = this.options.delayRenderTips || false;
|
this.delayRenderTips = this.options.delayRenderTips || false;
|
||||||
|
this.itemTemplate = this.options.itemTemplate || _.template([
|
||||||
|
'<div class="style" id="<%= id %>">',
|
||||||
|
'<img src="<%= imageUrl %>" width="' + this.itemWidth + '" height="' + this.itemHeight + '"/>',
|
||||||
|
'<% if (typeof title !== "undefined") {%>',
|
||||||
|
'<span class="title"><%= title %></span>',
|
||||||
|
'<% } %>',
|
||||||
|
'</div>'
|
||||||
|
].join(''));
|
||||||
|
|
||||||
this.fieldPicker = new Common.UI.DataView({
|
this.fieldPicker = new Common.UI.DataView({
|
||||||
cls: 'field-picker',
|
cls: 'field-picker',
|
||||||
allowScrollbar: false,
|
allowScrollbar: false,
|
||||||
itemTemplate : _.template([
|
itemTemplate : this.itemTemplate,
|
||||||
'<div class="style" id="<%= id %>">',
|
|
||||||
'<img src="<%= imageUrl %>" width="' + this.itemWidth + '" height="' + this.itemHeight + '"/>',
|
|
||||||
'<% if (typeof title !== "undefined") {%>',
|
|
||||||
'<span class="title"><%= title %></span>',
|
|
||||||
'<% } %>',
|
|
||||||
'</div>'
|
|
||||||
].join('')),
|
|
||||||
delayRenderTips: this.delayRenderTips
|
delayRenderTips: this.delayRenderTips
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -128,15 +130,9 @@ define([
|
||||||
restoreHeight: this.menuMaxHeight,
|
restoreHeight: this.menuMaxHeight,
|
||||||
style: 'max-height: '+this.menuMaxHeight+'px;',
|
style: 'max-height: '+this.menuMaxHeight+'px;',
|
||||||
enableKeyEvents: this.options.enableKeyEvents,
|
enableKeyEvents: this.options.enableKeyEvents,
|
||||||
|
groups: this.groups,
|
||||||
store: this.store,
|
store: this.store,
|
||||||
itemTemplate : _.template([
|
itemTemplate : this.itemTemplate,
|
||||||
'<div class="style" id="<%= id %>">',
|
|
||||||
'<img src="<%= imageUrl %>" width="' + this.itemWidth + '" height="' + this.itemHeight + '"/>',
|
|
||||||
'<% if (typeof title !== "undefined") {%>',
|
|
||||||
'<span class="title"><%= title %></span>',
|
|
||||||
'<% } %>',
|
|
||||||
'</div>'
|
|
||||||
].join('')),
|
|
||||||
delayRenderTips: this.delayRenderTips
|
delayRenderTips: this.delayRenderTips
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue