Portlet – limit moving options

Home Forums Porto Admin – Responsive HTML5 Template Portlet – limit moving options

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #10025867
    poisons
    Participant

    Hi, I’ve a list of 10 dynamically created portlet, only one vertical list. I would like to have the first 2 portlets fixed, and starting from the third portlet giving the option to be moveable through the list, of course not before its actual position (third).

    Hot to implement this with your portlet plugin?


    #10025869
    Support
    Keymaster

    Hello, just remove the data-portlet-item from the items that you want to be fixed.

    Example:
    FROM:

    <section class="card card-primary" id="card-1" data-portlet-item>

    TO

    <section class="card card-primary" id="card-1">

    Best Regards,

    Jonas


    #10025924
    poisons
    Participant

    Thanks Jonas.
    What about doing it dynamically?
    It works if I’m building the list up statically, but if I dynamically remove the data-portlet-item the portlet itself is anyway draggable.

    Another thing, while I build it statically, without the data-portlet-item, the actions don’t work (toggle the content and remove the portlet)

    Regards


    #10025945
    Support
    Keymaster

    Hello,

    – To call the porlet init function after you finish adding the portlets you need to add this:

    // Portlets
    (function($) {
    
    	'use strict';
    
    	$(function() {
    		$('[data-plugin-portlet]').each(function() {
    			var $this = $( this ),
    				opts = {};
    
    			var pluginOptions = $this.data('plugin-options');
    			if (pluginOptions)
    				opts = pluginOptions;
    
    			$this.themePluginPortlet(opts);
    		});
    	});
    
    }).apply(this, [jQuery]);

    – It will resolve both problems.

    – You can also remove the events and start the portlets again by adding this:

    $('[data-plugin-portlet]').off()

    Best Regards,

    Jonas


Viewing 4 posts - 1 through 4 (of 4 total)

This topic is marked as "RESOLVED" and can not rceive new replies.