jquery plugins - x-editable access attribute value of trigger element -


i using x-editable in-line editing inside web app. pass additional parameters server, read data- attributes on trigger element. here editable element:

<a href="#" data-url="save_url" data-pk="271" data-type="text" data-value="value" class="editable" data-param="xxx">value</a> 

i pass data-param attribute, don't know how access trigger element. tried via $(this).data('param'), null... full editable code:

$.fn.editable.defaults.mode = 'inline'; $('.editable').editable({     params: { param: $(this).data('param') } }); 

calling $('.editable').data('param') doesn't come account since have many .editable elements present.

thanks

i figured out. i'm answering in case needs know:

$('.editable').editable({     params: function(params) {         // add additional params data-attributes of trigger element         params.param1 = $(this).editable().data('param');         params.param2 = $(this).editable().data('nextparam');         return params;     } ) 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -