0
인터페이스의 아이콘을 사용하여 X- 편집 가능한 팝업을 트리거하고 싶지만 텍스트 콘텐츠를 이미지로 바꾸는 방법을 알 수 없습니다.x- 편집 가능한 이미지를 사용하여 선택
x- 편집 가능 (부트 스트랩 용)으로이 작업을 수행 할 수있는 방법이 있습니까? 아니면 처리 방법을 직접 만들어야합니까?
인터페이스의 아이콘을 사용하여 X- 편집 가능한 팝업을 트리거하고 싶지만 텍스트 콘텐츠를 이미지로 바꾸는 방법을 알 수 없습니다.x- 편집 가능한 이미지를 사용하여 선택
x- 편집 가능 (부트 스트랩 용)으로이 작업을 수행 할 수있는 방법이 있습니까? 아니면 처리 방법을 직접 만들어야합니까?
이 기능을 찾고 있거나 더 나은 방법이있는 사람을 위해이 기능을 남겨 두었습니다.
HTML :
<p>X-editable: single reqular checkbox</p>
<div style="margin: 150px">
<img id="check" src="http://png-4.findicons.com/files/icons/2152/snowish/128/dialog_warning.png"/>
</div>
JS는 :
$('#check').editable({
type: 'checklist',
url: '/post',
pk: 1,
placement: 'right',
title: 'Option 1',
source: {'1': 'enabled'},
emptytext: 'disabled',
success: function(data, config) {
if(data == '1'){
$("#check").attr("src", "http://png-2.findicons.com/files/icons/808/on_stage/128/symbol_check.png");
}else{
$("#check").attr("src", "http://png-4.findicons.com/files/icons/2152/snowish/128/dialog_warning.png");
}
}
});
var a=0;
//ajax emulation. Type "err" to see error message
$.mockjax({
url: '/post',
responseTime: 400,
response: function(settings) {
if(settings.data.value == 'err') {
this.status = 500;
this.responseText = 'Validation error!';
} else if(settings.data.value[0] == '1') {
this.responseText = '1';
}else{
this.responseText = '0';
}
}
});
그래서 체크 박스가 너무 일하는 것이 몇 가지 항목을 가지고,하지만 난 거기에 같은 문제가 생겼어요 - 체크 박스 항목은 텍스트 일 수 있습니다. – Daniel