Skip to content
This repository was archived by the owner on Jul 10, 2025. It is now read-only.
This repository was archived by the owner on Jul 10, 2025. It is now read-only.

Get selectable instance #22

@MR-AMDEV

Description

@MR-AMDEV

1. How can i get the Selectable instance using class/filter (whatever was added during initiation)
So as we can get it even if it is defined in Function ?

2. And also if i call a function whenever i click a refresh button , the instances are getting generated constantly and cause the system to lag.There should be an option so that along with creating new instance each time the previous should be destroyed OR one instance option and it refreshes only.

function selectableInit(element,getInstance){
	const selectable = new Selectable({
		appendTo: '.fm-data',
		autoRefresh: true,
 		autoScroll: {
			threshold: 0,
			increment: 20,
		}, 
		classes: {
			lasso: "ui-lasso",
			selected: "ui-selected",
			container: "ui-container",
			selecting: "ui-selecting",
			selectable: "ui-selectable",
			unselecting: "ui-unselecting"
		},		
		filter: element,
		lasso:{
			border: '1px solid inherit',
			backgroundColor: 'rgba(52, 152, 219, 0.2)',
			zIndex: '1',
		},
		tolerance: 'touch'
	});
	
	if(getInstance == 'get'){
		return selectable.getSelectedNodes();
	}
};

3. The plugin should work for updating(dynamic) elements It should look for the class of how many elements so we have to initiate it only one time and it looks for elements , since there is an auto refresh option this should serve the purpose of re initiating/refreshing.

Thanks for the beautiful plugin

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions