最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Spring boot + thymeleaf 后端直接給onclick函數(shù)賦值的實(shí)現(xiàn)代碼

 更新時(shí)間:2017年06月21日 17:11:56   作者:十年面壁  
這篇文章主要介紹了Spring boot + thymeleaf 后端直接給onclick函數(shù)賦值的實(shí)現(xiàn)代碼,需要的朋友可以參考下

 這里是控制器里返回的 

  /** 
   * @param pageUtil   分頁(yè)工具類 
   * @param cliCorpQuery 查詢類 
   * @param model    model 
   * @return String 
   */ 
  @RequestMapping(value = {"/list"}, method = RequestMethod.GET) 
  public String list(PageUtil<CliCorp> pageUtil, CliCorpQuery cliCorpQuery, Model model) { 
    PageUtil<CliCorp> corps; 
    try { 
      corps = corpClientService.queryByPage(pageUtil, cliCorpQuery); 
    } catch (Exception e) { 
      logger.error("queryByPage error:" + e.getMessage()); 
      return "queryByPage error"; 
    } 
    model.addAttribute("corps", corps); 
    return VIEW_PATH + "list"; 
  } 

頁(yè)面

<tr th:each="corp:${corps.contents}"> 
                    <td><span th:text="${corp.name}"></span></td> 
                    <td><span th:text="${corp.creditCode}"></span></td> 
                    <td><span th:text="${corp.taxNo}"></span></td> 
                    <td><span th:text="${corp.showName}"></span></td> 
                    <td><span th:text="${corp.bank}"></span></td> 
                    <td><span th:text="${corp.bankAccount}"></span></td> 
                    <td><span th:text="${corp.agent}"></span></td> 
                    <td><span th:text="${corp.address}"></span></td> 
                    <td><span th:text="${corp.status}"></span></td> 
                    <td><span th:text="${corp.creator}"></span></td> 
                    <td> 
                      <button type="button" th:onclick="'javascript:check('+${corp.id}+',2)'">審核 
                      </button> 
                      <button type="button" th:onclick="'javascript:check('+${corp.id}+',3)'">拒絕 
                      </button> 
                    </td> 
                  </tr> 

JS

function check(id, status) { 
   $.ajax({ 
     type: "POST", 
     data: {id: id, status: status}, 
     url: "/admin/corp/check", 
     success: function (data) { 
       if (data == "認(rèn)證成功") { 
         window.location.href = ("/admin/corp/list"); 
       } else { 
         alert("認(rèn)證失敗"); 
       } 
     }, 
     error: function (data) { 
       alert("認(rèn)證失敗"); 
     } 
   }); 
 } 

以上所述是小編給大家介紹的Spring boot + thymeleaf 后端直接給onclick函數(shù)賦值的實(shí)現(xiàn)代碼,希望對(duì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!

相關(guān)文章

最新評(píng)論

远安县| 嘉善县| 济南市| 武夷山市| 阿勒泰市| 济源市| 静宁县| 寻乌县| 杂多县| 宜兰县| 新巴尔虎右旗| 抚顺县| 福清市| 贺兰县| 曲松县| 千阳县| 都匀市| 灵川县| 封开县| 潜山县| 乌兰察布市| 沙田区| 万源市| 泸定县| 长泰县| 龙州县| 庐江县| 股票| 聂拉木县| 会理县| 乌苏市| 茂名市| 平陆县| 班玛县| 斗六市| 杭锦后旗| 安徽省| 通渭县| 胶南市| 安义县| 靖安县|