Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to apply plugin in a "live" fashion

Tags:

jquery

cluetip

Is there a way to apply plugin to element in a "live" fashion, just like we can attach handler that survives ajax calls? Right now we have some code that uses "cluetip" in a rad grid, but after ajax, it gets dropped.

$('a.clickableSticky').cluetip({
                    splitTitle: '|',
                    showTitle: false,
                    titleAttribute: 'description',
                    activation: 'click',
                    sticky: true,
                    arrows: true,
                    closePosition: 'title'
                });
like image 831
epitka Avatar asked Jun 24 '10 18:06

epitka


People also ask

What are plugins in WooCommerce?

Plugins are the best part of making an online store using WooCommerce. They allow you to add new features and grow your business. There are tons of free and paid plugins that you can use but not all of them are good. So, it's hard to find the best WooCommerce plugins for your eCommerce site.

Is WooCommerce a free plug in?

WooCommerce helps you sell products and services from your WordPress site. It's a free WordPress plugin with additional features available as extensions. WooCommerce is made by Automattic, the corporate arm of WordPress, so when you use it, you're in good hands.


1 Answers

Live only works on events, so you can't do it with clue tip.

You can still run cluetip on any newly created elements though.

So...

$('#grid').live('gridRefreshEvent', function () {
 $('#grid').find('a.clickableSticky').cluetip({ splitTitle: '|', showTitle: false, titleAttribute: 'description', activation: 'click', sticky: true, arrows: true, closePosition: 'title' });
}

Edit:

If the plugin doesn't provide an event, you can hack the plugin to create your own event by finding the ajax function in their code and adding: $('#grid').trigger('gridRefreshEvent'); somewhere.

You can also try asking RadGrid support about the event. Any non-dumb dev would add basic things like this.

like image 182
Mark Avatar answered Oct 27 '22 05:10

Mark