EasyUi After opening the dialog box the control assignment and the solution to the problem that the control does not display after assignment
- 2021-07-12 04:59:00
- OfStack
1: First of all, the assignment can only be done after the page is loaded, that is, in onLoad;
2: Because the textbox control is used in the input field in dialog, if you need to assign a value, you should call the assignment method of textbox instead of
$('#userName').val(row[0].User_name);
Because the textbox control of easyui hides the original input field after initialization, and what the control actually shows is the input field generated by easyui. You can use a browser to view the dom structure after initialization of the control.
So modify the assignment statement to
$('#dilog_id').textbox("setValue",row.id);
That's enough.
title: " Modify user information ",
href:"/Manage/ModiUsers",
width: 500,
height: 600,
onLoad: function () {
$("#userName").textbox("setValue",row[0].User_id); // The right way
$("#userName").val(row[0].User_name); / / Wrong method
},