About datagrid dynamically generate lines, can not compile, and delete some problems on the code.

generated lines cannot be compiled, and deleting code has no effect at all

    $("-sharpButton_Add_Row_Add").linkbutton({
        onClick : function() {
            $("-sharpdg_Arrival_Inspection_Notice_Detail_Add").datagrid("appendRow",{});
            
//            var index=$("-sharpdg_Arrival_Inspection_Notice_Detail_Add").datagrid("appendRow", {         
//                FlowTypeName: "new name",
//                FlowTypeCode: 30                
//            }).datagrid("getRows").length-1;
//            $("-sharpFlowList").datagrid("beginEdit",index)
//            alert(index);
        }
    });
    
    $("-sharpButton_Remove_Row_Add").linkbutton({
        onClick : function() {
            //var lRow_Selected = $("-sharpdg_Arrival_Inspection_Notice_Detail_Add").datagrid("cell");
            //if (lRow_Selected != null) {
                $("-sharpdg_Arrival_Inspection_Notice_Detail_Add").datagrid("deleteRow", lRow_Selected.index);
            //}
        }
    });

clipboard.png
this is after it is generated. It is all selected at one point, and cannot be compiled

.
Oct.10,2021
Menu