6

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'
                });
epitka
  • 17,275
  • 20
  • 88
  • 141

1 Answers1

1

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.

Mark
  • 32,293
  • 33
  • 107
  • 137
  • problem is that I have not clue what that 'gridRefereshEvent' is on RadGrid. God, do I hate RadGrid based solutions. – epitka Jun 24 '10 at 18:22