2024年4月30日发(作者:)
前端:
1
2
3
4
$(function
() {
5
load();
6
})
7
8
function
syncJsonTofrom($form,entity)
9
{
10
for
(var
key in
entity) {
11
var
$control = $("[name="
+ key + "]");
12
if
($control) {
13
if
($("type") == "checkbox"
&& entity[key]) {
$("checked", true);
14
}
15
$(entity[key]);
16
}
17
}
}
18
function
load() {
19
$.post("/Test/LoadAll", function
(res) {
20
var
entity = res[0];
21
syncJsonTofrom($("#frm"),entity);
22
})
23
24
}
25
40
41
42


发布评论