Sha256: 1cb0139c9f26e45d66057c761ecadeb2a8816e4a2dc7a06cd45899749f3831ff

Contents?: true

Size: 678 Bytes

Versions: 5

Compression:

Stored size: 678 Bytes

Contents

include('../list.js');

/**
 * Flyweight view rendering
 * Used in lists, tables, grids
 */
uki.view.list.Render = uki.newClass({
    init: function() {},
    
    /**
     * Renders data to an html string
     * @param Object data Data to render
     * @return String html
     */
    render: function(data, rect, i) {
        return '<div style="line-height: ' + rect.height + 'px; font-size: 12px; padding: 0 4px;">' + data + '</div>';
    },
    
    setSelected: function(container, data, state, focus) {
        container.style.backgroundColor = state && focus ? '#3875D7' : state ? '#CCC' : '';
        container.style.color = state && focus ? '#FFF' : '#000';
    }
});

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
uki-1.1.1 frameworks/uki/src/uki-view/view/list/render.js
uki-1.1.0 frameworks/uki/src/uki-view/view/list/render.js
uki-1.0.2 frameworks/uki/src/uki-view/view/list/render.js
uki-1.0.1 frameworks/uki/src/uki-view/view/list/render.js
uki-1.0.0 frameworks/uki/src/uki-view/view/list/render.js