Sha256: 260b58512b297cd9cefcf9b83797c9526e4990b087e3dc659a4983740873fa45

Contents?: true

Size: 688 Bytes

Versions: 3

Compression:

Stored size: 688 Bytes

Contents

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

/**
 * Flyweight view rendering
 * Used in lists, tables, grids
 * @class
 */
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

3 entries across 3 versions & 1 rubygems

Version Path
uki-1.1.4 frameworks/uki/src/uki-view/view/list/render.js
uki-1.1.3 frameworks/uki/src/uki-view/view/list/render.js
uki-1.1.2 frameworks/uki/src/uki-view/view/list/render.js