jquery와 함께 jeditable을 사용하고 있으며 편집 가능 항목을 초기화 한 후 입력에 속성을 추가하려고합니다. jeditable에는이 가능성을 제공하는 함수가 포함되어 있지 않습니까?Jeditable jQuery - 초기화 후에 입력에 데이터 속성 추가
1
A
답변
0
이 시도 : 당신은 어떤 당신의 jeditable의 JS 파일에 해킹이 필요
$('.yourDivWrapper').on('focus', '.yourJEditElement input', function() {
var elem = $(this);
elem.attr('name', 'value');
});
0
. 그런 다음 , 당신은이 같은 속성을 가진 사용자 정의 입력을 추가 할 수 있습니다
$.editable.addInputType("customInput" , {
element : function(settings, original) {
var input = $('<input class="customClass"/>');
if (settings.width != 'none') {
input.width(settings.width);
}
if (settings.height != 'none') {
input.height(settings.height);
}
input.attr('autocomplete', 'off');
input.attr('customAttr', 'attr');
$(this).append(input);
return (input);
}
});
을 추가, 당신은 제출시 속성을 추가 할 같은 것을 할 경우 :
$.editable.addInputType("dfsInputNumbers" , {
element : function(settings, original) {
var input = $('<input >');
if (settings.width != 'none') {
input.width(settings.width);
}
if (settings.height != 'none') {
input.height(settings.height);
}
input.attr('autocomplete', 'off');
$(this).append(input);
return (input);
},
submit : function(settings, original) {
$('input', this).attr("customAttr", "attr") {
}
});
나는 것을 테스트하지 않았습니다를 하나지만 아직 해킹하고 일부 입력 유형을 추가했습니다. 자습서를 확인하십시오 : http://www.appelsiini.net/projects/jeditable/custom.html