Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get selectable instance #22

Closed
MR-AMDEV opened this issue Jan 27, 2019 · 2 comments
Closed

Get selectable instance #22

MR-AMDEV opened this issue Jan 27, 2019 · 2 comments

Comments

@MR-AMDEV
Copy link

MR-AMDEV commented Jan 27, 2019

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

@MR-AMDEV
Copy link
Author

MR-AMDEV commented Feb 1, 2019

Any update?

@Mobius1 Mobius1 closed this as completed in 4e471df Sep 8, 2020
@Mobius1
Copy link
Owner

Mobius1 commented Sep 8, 2020

See Retrieving Instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants