请教一下在TP 5.0RC中I函数这样用规范不?

浏览:956 发布日期:2016/03/15 分类:求助交流
模板采用EASYUI作为主界面,其中有一段代码向后台POST数组,代码如下//选择操作
        var checkedItems = $('#tgMain').treegrid('getChecked'); //得到选择的记录
        var checkedRowsIds = [];
        //设置存放记录某个字段的数组
        var checkedRowsNum = 0;
        //设置计数器
        $.each(checkedItems, function(index, item) {
            checkedRowsNum = checkedRowsNum + 1;
            checkedRowsIds.push(item.id);
        });

//提交开始
                    $.post('{$Think.const.__ABIS_CONTROLLER__}/setup_menu_list_submit', {
                        //提交标识--del为删除标志
                        submit_value: 'del',
                        //提交的参数
                        ids: checkedRowsIds
                    }, function(result) {
                        if (result.return_code == '0') {
                            //提交成功
                            //重新载入
                            $('#tgMain').treegrid('reload');
                        } else {
                            //提交失败
                        }
                        //提示信息
                        showRightBottomMsg('information', '信息', result.return_msg, '3000', 'slide');
                    }, 'json');
其中checkedRowsIds为数组格式

后台在接收时先是用 $ids = I('ids');无法接收到传过来的ids,经过摸索,我改用如下代码则正常 $ids = I('ids/a');请教一下,后者的用法规范否?
在3.2.3中,是不需要加上“/a”这个参数就可以获得的,能否在5.0中改进一下?

多谢官方
最佳答案
评论( 相关
后面还有条评论,点击查看>>