Add/edit/delete in jqGrid with Web API

后端 未结 2 502
無奈伤痛
無奈伤痛 2021-01-25 02:26

I am new to jqGrid and need some help on form add/edit/delete functionality. Havent found any relevant resources so far. My grid is displaying pop up on add/edit, also populatin

2条回答
  •  孤独总比滥情好
    2021-01-25 02:55

    You need to add URL parameter in your editOption, addOption, deleteOption

    var editOption = {
        width:400,
        height:290,
        left:20,
        top:30,
        reloadAfterSubmit:false,
        jqModal:false,
        editCaption: "Edit Record",
        bSubmit: "Submit",
        bCancel: "Cancel",
        closeAfterEdit:true,
        url:'http://localhost:50570/api/Test/EditEmployee'
    };
    
    var addOption = {
        width:400,
        height:290,
        left:20,
        top:30,
        reloadAfterSubmit:false,
        jqModal:false,
        addCaption: "Add Record",
        bSubmit: "Submit",
        bCancel: "Cancel",
        closeAfterAdd:true,
        url:'http://localhost:50570/api/Test/AddEmployee'
    };
    
    var delOption = {
        caption: "Delete",
        msg: "Delete selected record(s)?",
        bSubmit: "Delete",
        bCancel: "Cancel",
        url:'http://localhost:50570/api/Test/DeleteEmployee'
    };
    

提交回复
热议问题