easyUI gets the data of the selected row

Some need to do some modification functions, so how to get the data of the selected row and assign the data to the new edit box? The API also provides us with a property getSelected. The specific usage is as follows:

    //Modify data
    function doEdit() {
        $('#w').window('open');//Open a new edit box
        var row = $('#dg').datagrid('getSelected');/ /Get the data of the selected row
        if (row) {

                //Assign the data in the selected row of the table to the new modification box

                   //textbox represents the cell in which row of data you selected uses easyui-textbox of easyUI;

                $('#UserId').textbox('setValue', row["UserID"]);
                $('#InfoUser').textbox('setValue', row["LoginName"]);

                $('#UserInfoName').textbox('setValue', row["UserName"]);

                //combobox represents the cell in which row of data you selected uses easyui-combobox of easyUI; that is, the drop-down box

                $('#UserInfoBM').combobox('setValue', row["DeptName"]);
                $('#UserInfoPosition').combobox('setValue', row["StationName"]);
                $('#UserInfoAuthority').combobox('setValue', row["RoleName"]);
            }
    }

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325693278&siteId=291194637