javascript - javascript __proto__:使用 kendoComboBox 时 init 和 object 之间的区别
问题描述
我尝试将 KendoComboBox 与以下配置的数据源一起使用
....
dataSource: {
type: "json",
serverFiltering: true,
transport: {
read: {
url: __url,
contentType: "application/json;",
dataType: "json"
}
}
},
....
这就是我从 php 发送的内容:
.....
$searchResult[] = array(
'value' => $object->getCode(),
'text' => $object->getCode(),
'pieceDetails' => $object,
'rowsDetails' => $object->getRows()->toArray(),
);
return new JsonResponse($searchResult);
但是当我尝试在控制台浏览器中的更改事件之后显示选定的数据项时
change: function (e) {
var object = this.dataItem();
console.log(object);
}
我发现这个结果是这样的:
init {_events: {…}, _handlers: {…}, value: "BCC/0025", text: "BCC/0025", pieceDetails: init, …}
parent: ƒ ()
pieceDetails: init {_events: {…}, _handlers: {…}, client: init, trLivraison: "1", trFacture: "0", …}
rowsDetails: init(3) [init, init, init, type: ƒ, _events: {…}, parent: ƒ]
text: "BCC/0025"
uid: "12472ae6-0baa-4ae2-a78b-0a980d1c8d17"
value: "BCC/0025"
_events: {change: Array(1)}
_handlers: {pieceDetails: {…}, rowsDetails: {…}}
__proto__: init
那么我怎样才能只恢复选定的对象,就像我从一个简单的 ajax 响应中恢复一样:
{pieceDetails: {…}, rowsDetails: Array(3), mtRpGlobal: 0}
pieceDetails: {client: {…}, trLivraison: "1", trFacture: "0", code: "BCC/0025", date: {…}, …}
rowsDetails: (3) [{…}, {…}, {…}]
__proto__: Object
__proto__: init
还有一个问题和有什么区别
__proto__: Object
解决方案
推荐阅读
- c# - 假设它是整数,将浮点整数作为字段添加到 InfluxData.Net 会引发异常
- c++ - while()中调用了lambda表达式,为什么要在lambda表达式后面加()
- regex - 如何在 Vim 中修剪匹配的字符?
- java - 使用 LIKE 关键字从 Java 中的 oracle 数据库中搜索
- actionscript-3 - 无法从正常大小切换视频
- python - 重定向时 /upload/ 处的 NoReverseMatch
- c - C - 调用函数并给出二维数组
- c - 如何在 C 中的字符串内设置变量占位符
- c++ - 模板 ID 不匹配任何模板声明
- visual-studio - DEVENV 命令行构建失败:“此操作可能只发生在 UI 线程中”