Title: passing parameters to ajax tooltip Post by: kirschkern_1992 on July 12, 2013, 12:15:54 AM good morning
i have a short question: i implemented an ajax tooltip. for my plan, i have to pass parameters to the ajax request of the tooltip, but i dont find a nice solution for this problem thats my tooltip Code: <a class="easyui-tooltip" data-options="position: 'right', content: $('<div></div>'),onUpdate: infoTooltipOnUpdate" href="#"> onupdate function: Quote function infoTooltipOnUpdate(content){ content.panel({ width: 300, height: 'auto', border: false, href: ajaxUrl + '?PARAM1=123&PARAM2=456&PARAM3......' }); } the tooltip is in a grid. for each row in the grid, an tooltip-icon exists. so for each grid row other content should be shown. to realize that, i have to pass parameters to the tooltip-request, but i dont find a nice solution i solved the problem with an attribute in the tooltip: Code: <a class="easyui-tooltip" data-options="position: 'right', content: $('<div></div>'),onUpdate: infoTooltipOnUpdate" href="#" param1="123"> Quote function infoTooltipOnUpdate(content){ var param1 = $(this).attr('param1'); content.panel({ width: 300, height: 'auto', border: false, href: ajaxUrl + '?PARAM1=' + param1 }); } does anyone know an better solution? thx for help Title: Re: passing parameters to ajax tooltip Post by: stworthy on July 12, 2013, 01:48:33 AM You can add customized property in 'data-options' attribute.
Code: <a class="easyui-tooltip" data-options="position: 'right',onUpdate: infoTooltipOnUpdate, param1:'123'"> Code: function infoTooltipOnUpdate(content){ Title: Re: passing parameters to ajax tooltip Post by: kirschkern_1992 on July 12, 2013, 05:22:39 AM ok thx for other solution :D
|