使用具体的cms在Jqgrid中删除功能不起作用

时间:2014-02-13 07:01:36

标签: jquery-ui jqgrid concrete5

我在Concrete5 cms工作,我不知道这段代码有什么问题,

查看页面脚本

var myData = <?php echo json_encode($sl) ?>;

    $("#statGrid").jqGrid({
        caption: 'Status List',
        datatype:'local',
        data: myData,
        mtype:'POST',
        colNames:['sID','Status Name','Type','Description'],
        colModel:[ 
            {name:'status_id',editable:true }, 
            {name:'status_name',editable:true },
            {name:'status_type',editable:true },
            {name:'status_description', editable:true, edittype: 'textarea' } ],
        width: "777",
        height: "auto",
        pager:'#statPager',
        rowNum:5, 
        rowList:[5,10,20,30],
        rownumbers: true,
        viewrecords: true,
        recreateForm:true,
        gridView: true,
        autoencode: true,
        loadui:'enable'

    }).navGrid("#statPager",{add:false, edit:false, view:false, del:true, search:false, refresh:false },
    {
    reloadAfterSubmit: true,
    jqModal: true,
    closeOnEscape: true,
    closeAfterEdit: true,
    url: "deleteStatus",
    afterSubmit: function (response, postdata) {
        if (response.responseText == "Success") {
            jQuery("#success").show();
            return [true, response.responseText];
        } else {
                    return [false, response.responseText];
            }
        }
    });

请any1帮助如何在“deleteStatus”功能的url中调用我的控制器功能。

还有一件事是“closeOnEscape:true不起作用”

1 个答案:

答案 0 :(得分:0)

正如我所看到的,你已将删除参数放到错误的位置。

jQuery(“#grid_id”)。navGrid('#gridpager',{parameters},prmEdit,prmAdd, prmDel ,prmSearch,prmView);

http://www.trirand.com/jqgridwiki/doku.php?id=wiki:navigator

http://www.trirand.com/jqgridwiki/doku.php?id=wiki:form_editing

所以,在你的情况下试试:

.navGrid("#statPager",{add:false, edit:false, del:true, search:false, refresh:false },
        {},{},
        {
        reloadAfterSubmit: true,
        jqModal: true,
        closeOnEscape: true,
        url: "deleteStatus",
        afterSubmit: function (response, postdata) {
            if (response.responseText == "Success") {
                jQuery("#success").show();
                return [true, response.responseText];
            } else {
                        return [false, response.responseText];
                }
            }
        }
,{},{});