zoukankan      html  css  js  c++  java
  • sea.js中的checkbox批量操作

    <table width="100%" border="0" cellspacing="0" cellpadding="0">
    	<tr>
    	  <th scope="col" width="60"><input type="checkbox" class="checkbox" id="all" />全部</th>
    	  <th scope="col">主题</th>
    	  <th scope="col">消息类型</th>
    	  <th scope="col">发送时间</th>
    	</tr>
    	
    	{@each data as item}
    	<tr>
          <td><input type="checkbox" class="checkbox" /></td>
          <!--0:已读,1:未读  -->
          {@if item.is_new==1}
          <td class="toolmsg"><a href="javascript:void(0);" id="${item.id}" title="${item.title}" create_time="${item.create_time}" 
          content="${item.content}" message_type="${item.message_type}">${item.title}</a></td>
          {@else}
           <td class="toolmsg"><a class="active" href="javascript:void(0);" id="${item.id}" title="${item.title}" create_time="${item.create_time}" 
          content="${item.content}" message_type="${item.message_type}">${item.title}</a></td>
          {@/if}
          
         <!--  0-系统消息  1-商城消息  -->
          {@if item.message_type==1}
          <td>商城消息</td>
          {@else}
           <td>系统消息</td>
          {@/if} 
          <td>${item.create_time}</td>
        </tr>
        {@/each}
    </table>
    
    /**
         * 获取选中对应的值
         */
        function getCheckedValue(){
            var msg_id = "";
            $(".table_main").find("table").find("tr:gt(0)").find("input").each(function(index, item){
                if($(this).prop("checked")){
                    msg_id += $(this).attr("value") + ",";
                }
            });
            return msg_id;
        }
    //全选/反选
                    var subInputObj = $(".table_main").find("table").find("tr:gt(0)").find("input");
                    $("#all").bindEvent(function(){
                        if($(this).prop("checked")){
                            $(subInputObj).prop("checked", true);
                        }else{
                            $(subInputObj).prop("checked", false);
                        }
                    });
  • 相关阅读:
    redis--迁库操作
    python-又来练习题--输出一个字符串中最长的子字符串及其长度
    python-接口开发flask模块(三)开发登陆接口
    python-接口开发flask模块(二)全局host配置
    python-接口开发flask模块(一)工具类准备
    Celery定时任务|计划任务
    Celery多任务结构
    Celery
    正向代理与反向代理
    drf 视图源码详解
  • 原文地址:https://www.cnblogs.com/wangzhuxing/p/5432711.html
Copyright © 2011-2022 走看看