zoukankan      html  css  js  c++  java
  • springmvc DWZ框架 选中行取值 alertMsg.confirm()方法

    //删除              onclick方法进入deleteshop方法
    function deleteshop() {
    var shopid = $("#tableshoplist").find(".selected").attr("rel");                    //选中行取值
    alertMsg.confirm("确定要删除该设备吗?", {                    //框架下的信息弹出框
    okCall: function(){                                                 //确定回调函数
    $.ajax({
    url:"${ctx}/beauty/deleteShop?id="+shopid,
    type:'GET',
    cache:false,
    error:function(){
    alertMsg.warn('请正确操作!');
    },
    success:function(data){
    if(data ==0)
    {
    // layer.msg("正在使用中,无法删除!");
    alertMsg.warn('正在使用中,无法删除!');
    }
    else
    {
    alertMsg.correct('删除成功!');
    navTab.reloadFlag("beauty");
    }
    }
    });
    },
    cancelCall : function() {}
    });
    }

    后台Controlleer部分

    @RequestMapping("/deleteShop")
    @ResponseBody
    public String deleteShop(int id) {              //接收参数
    try {
    btyshopService.delectbtyshop(id);
    } catch (Exception e) {
    return "0";
    }
    return "1";
    }
    }

    ---------------------------------------------------------------------------------------------------------------------------------------------------

    第二种参数传递方式

    function search() {
    var psize = $("#nowPageSize", navTab.getCurrentPanel()).val();
    var Searchinstid = $("#Searchinstid", navTab.getCurrentPanel()).val();
    var Searchname = $("#Searchname", navTab.getCurrentPanel()).val();
    if (Searchname == "") {
    Searchname = "all";
    }
    Searchname = encodeURIComponent(encodeURIComponent(Searchname));
    navTab.openTab("beauty", "${ctx}/beauty/Search/" + Searchname + "/"
    + Searchinstid, {
    title : "美容店管理",
    fresh : true,
    data : {
    page : 1,
    rows : psize
    }
    });
    }

    //后台Controller部分

    //分页查询
    @RequestMapping(value="/Search/{Searchname}/{Searchinstid}", method = RequestMethod.GET)      //接收参数
    public String Search(
    @RequestParam(required = false, defaultValue = "1") int page,
    @RequestParam(required = false, defaultValue = "20") int rows,
    @PathVariable("Searchname") String shopname,
    @PathVariable("Searchinstid") Integer institutionid,                  //使用参数
    HttpServletRequest request, Model model){
    try {
    shopname = URLDecoder.decode(shopname, "UTF-8");
    } catch (Exception ex) {
    }
    if (shopname.equals("all")) {
    shopname = "";
    }
    PageHelper.startPage(page, rows);
    List<BtyShop> list = btyshopService.SearchSearch(shopname,institutionid);
    request.setAttribute("pageInfo", new PageInfo<BtyShop>(list));
    List<Inst> insts = instService.getAll();
    request.setAttribute("insts", insts);
    request.setAttribute("shoplist", list);
    // 回写查询数据
    model.addAttribute("Searchshopname", shopname);
    model.addAttribute("Searchinstitutionid", institutionid);
    return "basic/Beautyshop";
    }

    当能力支撑不了野心时,就该静下心来学习!
  • 相关阅读:
    ListView 分页显示(转载+修改)下
    ListView 分页显示(转载+修改)上
    Android_开发片段(Part 1)
    JSCH执行linux命令
    linux运行wkhtmltopdf
    Apache HttpClient
    JDK自带的URLConnection
    java poi读取excel
    CXF webservice完整例子
    Oracle 常用初始化命令
  • 原文地址:https://www.cnblogs.com/1234cjq/p/5799197.html
Copyright © 2011-2022 走看看