forked from fanruan/fineui
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.0 KiB
41 lines
1.0 KiB
Demo.Func = BI.inherit(BI.Widget, { |
|
props: { |
|
baseCls: "demo-func" |
|
}, |
|
render: function () { |
|
var items = []; |
|
var cellCount = 100; |
|
for (var i = 0; i < cellCount; i++) { |
|
items[i] = { |
|
type: "bi.label", |
|
text: i |
|
}; |
|
} |
|
var grid = BI.createWidget({ |
|
type: "bi.collection_view", |
|
width: 400, |
|
height: 300, |
|
items: items, |
|
cellSizeAndPositionGetter: function (index) { |
|
return { |
|
x: index % 10 * 50, |
|
y: Math.floor(index / 10) * 50, |
|
width: 50, |
|
height: 50 |
|
} |
|
} |
|
}); |
|
BI.createWidget({ |
|
type: "bi.absolute", |
|
element: this, |
|
items: [{ |
|
el: grid, |
|
left: 10, |
|
right: 10, |
|
top: 10, |
|
bottom: 10 |
|
}] |
|
}) |
|
} |
|
}); |
|
BI.shortcut("demo.collection_view", Demo.Func); |