Files
2026-04-28 21:15:09 +03:00

45 lines
1020 B
PHP

<?php
$column = [];
$column['name'] = post("name");
$column['type'] = post("type");
$column['relation'] = []; //json_decode(post("relation"));
$relationDatas = [];
$relationDatas[$column['name']] = [];//$column['relation'];
$rowName = "click-edit";
$tableName = post("table_name");
$unique = post("id") . post("name");
$listData = db($tableName)->where("id", post("id"))->first();
?>
<div class="editable-zone" id="{{$unique}}">
@include("components.columns.{$column['type']}")
</div>
<script>
$("#{{$unique}} input").on("blur", function() {
var that = $(this);
var value = that.val();
$.post("{{ url('admin-ajax/input-edit') }}",{
table : that.attr("table"),
key : that.attr("key"),
value : that.val(),
_token : "{{ csrf_token() }}",
id : that.attr("data-id"),
name : that.attr("name")
},function(){
that.prop("disabled",false);
that.parent().parent().html(value).removeClass("edited");
that.prop("disabled",true);
});
});
</script>