jquery - Passing an attribute to input type in Jeditable -
i'm using jeditable edit , post changes different elements of page. i'd able specify whether edit type should text
or textarea
looking @ attribute in i'm editing, data-type_edit="textarea
example.
however, passing don't seem able pass value or attribute 2nd part of jeditable function specify type. why isn't type : $(this).attr('data-edit_type')
working in code:
$('.editable.edit-section').editable(function(value, settings) { var dbid = $(this).attr("data-db_id"); var dbtable = $(this).attr("data-db_table"); var dbcol = $(this).attr("data-db_col"); submitedit(value, dbid, dbtable, dbcol); // needed value correctedly displayed jeditable on page return(value); }, { type : $(this).attr('data-edit_type'), submit : "ok", cancel : "cancel", tooltip : "click edit...", onblur : "ignore" });
thanks!
try doing.
$(this).data('edit_type');
i believe correct way access data attributes through jquery
Comments
Post a Comment