All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.primefaces.mobile.widgets.datalist.js Maven / Gradle / Ivy

There is a newer version: 14.0.0-RC3
Show newest version
/**
 * PrimeFaces Mobile DataList Widget
 */
PrimeFaces.widget.DataList = PrimeFaces.widget.BaseWidget.extend({
    
    init: function(cfg) {
        this._super(cfg);
        
        this.jq.listview();
        this.items = this.jq.children('li');
        
        this.bindEvents();
    },
    
    bindEvents: function() {
        if(this.cfg.behaviors) {
            var $this = this;
            
            $.each(this.cfg.behaviors, function(eventName, fn) {
                $this.items.on(eventName, function() {
                    var ext = {
                        params: [{name: $this.id + '_item', value: $(this).index()}]
                    };
                            
                    fn.call($this, ext);
                });
            });
        }
    }
});




© 2015 - 2024 Weber Informatics LLC | Privacy Policy