Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82130

Get value from field in Editor with button

$
0
0
Hi,
I have create in editor 1 button with this :
$.fn.DataTable.Editor.fieldTypes.bt_ing = $.extend( true, {}, $.fn.DataTable.Editor.models.fieldType, {
"create": function ( conf ) {

// Create the elements to use for the input
conf._input = $(
'<div>'+
'<input type="button" class="buttonweb" id="btnAdd" value="Ajouter Ingrédient" />'+
'</div>')[0];

$('#btnAdd', conf._input).click( function () {
var idfam = $('select', editor.node('iding')).val();
alert(idfam);
} );
return conf._input;
}
} );
It function and show well the button when I create or edit. But I want to get a value when I click but nothing !
In console.log, it says that 'editor' is not defined...
Is it possible to get a value from a field with specific field type ? How ?

Thanks.
dts1

Viewing all articles
Browse latest Browse all 82130

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>