Grid remote tooltips

Hello,
I would like to show tooltip on a datatable cell, but the content of the tooltip should be retrieved thru an ajax call (unfortunatly it takes to long to render the content inline with the data). Is that possible and how do i do that?
Alternatively, is it possible to set the css class on cell level? (i do have an alternate solution for the tooltips, but i needs to be able to set the class for a single cell then).

Thanks,
Marc

Hello! As template of the tooltip can be a function, you can define it for specific items and load via ajax as well.

http://webix.com/snippet/d68ef543

By the way, there’s an example of the custom class for the cell. You can define it right in the dataset. Our docs may be helpful:

http://docs.webix.com/datatable__styling.html#cells

http://docs.webix.com/desktop__tooltip.html#datatabletooltip

Thanks, that should do the trick!

I have one more question regarding the remote tooltip: The snippet you referenced uses ajax.sync() which is deprecated and should not be used. Is there a function i can call from the async ajax response to set the tooltip?
Something like obj.setTooltip(responseText)?

The point is that async ajax does not return the tooltip in time. So its value stays undefined.

Could you extend the library to allow the return of a jquery deferred object that will provide the data once the ajax call returns? (deferred.done() | jQuery API Documentation)
Or could you provide a callback that we can call with the returned value to show the tooltip?

Hi,

Webix features the functionality of deferred objects but it cannot be used in the default tooltip implementation.

But you can create a tooltip instance separately and then attach show and hide handlers for the datatable to work with this tooltip. Check the following snippet, please:

http://webix.com/snippet/5591e50a