全选、反选
来源:互联网 发布:知乎英国梨和小苍兰 编辑:程序博客网 时间:2024/06/06 00:12
//Controller$isBldtbomFdxinbom = array();if(isset($v['sub_shipping_method']) && in_array ($v['sub_shipping_method'], Shipping_Service_ShipType::$bldtbomFdxinbom)){ $isBldtbomFdxinbom[$v['sub_shipping_method']] = $v['sub_shipping_method'] . '(' . $v['count'] . ')' . str_repeat(" ", 16-strlen($v['sub_shipping_method'] . '(' . $v['count'] . ')'));}$this->view->isBldtbomFdxinbom = array_reverse($isBldtbomFdxinbom,true);//Services//array_merge 合并一个或多个数组public static function indinShip() { $indinShip = array_merge(array('AMEXP', Shipping_Service_ShipType::$newShipping, 'FKEXP'), Shipping_Service_ShipType::$bldtbomFdxinbom); return $indinShip;}public static $bldtbomFdxinbom = array("BLDTBOM", "FDXINBOM");//Html<div style='border-top:1px solid #dedede;padding-bottom: 5px;padding-top:10px;clear:both;'> <label style="width:85px;"><span style="display:inline-block;color:blue;">请选择运输方式</span> <input type="checkbox" onclick="selectShipClick(3)" class="checkAll2" />全选/反选</label></div><div> <ul> <{foreach from=$isSendToIndia key=key item=ship_tp}> <li style="float:left;margin-left:10px;"><label><input name='ship_type[]' value='<{$key}>' onclick="selectShipClick(3)" type='checkbox' class='order_inexp'/><{$ship_tp}></label></li> <{/foreach}> </ul> <ul> <{foreach from=$isBldtbomFdxinbom key=k item=v}> <li style="float:left;margin-left:10px;"><label><input name='ship_type[]' value='<{$k}>' onclick="selectShipClick(3)" type='checkbox' class='order_inexp_v'/><{$v}></label></li> <{/foreach}> </ul></div>//Js//格式var k = 1;$(".order_inexp_v:checked").each(function(){ selectShip+=$.trim($(this).parent().text())+" "; if (parseInt(j) == 7) { selectShip+= "<br>"; k = 0; } k++;});//反选function selectShipClick(type){ if(type==2){ $(".order_ship").attr('checked',false); $(".checksAll").attr('checked',false); $(".checkAll2").attr('checked',false); $(".order_inexp").attr('checked',false); $(".order_inexp_v").attr('checked',false); }else if(type==3){ $(".order_ship").attr('checked',false); $(".checksAll").attr('checked',false); $(".ship_type_one").attr('checked',false); }else{ $(".checkAll2").attr('checked',false); $(".order_inexp").attr('checked',false); $(".ship_type_one").attr('checked',false); $(".order_inexp_v").attr('checked',false); }}//二选一$(".checkAll2").click(function(){ $(".checkAll2").is(":checked")?$(".order_inexp").attr("checked",true):$(".order_inexp").attr("checked",false); $(".order_inexp_v").attr("checked",false);});$(".order_inexp_v").click(function(){ if($(".order_inexp_v").is(":checked")){ $(".order_inexp").attr("checked",false); }});$(".order_inexp").click(function(){ if($(".order_inexp").is(":checked")){ $(".order_inexp_v").attr("checked",false); }});//传选择后的参数$(".order_inexp_v:checked").each(function(){ orderShip.push($(this).val());});var params = {"ship_type":orderShip};data:params,
阅读全文
0 0
- javascript全选 反选
- 全选,反选代码
- 全选反选
- jquery全选反选
- CListCtrl全选、反选
- jquery 全选反选
- CheckBoxList 全选,反选
- JS全选,反选
- Jquery 全选、反选
- javascript 全选 反选
- 全选和反选
- checkbox全选反选
- 全选与反选
- jquery -全选/反选
- 全选、反选
- js 全选 ,反选
- 全选反选
- 全选,反选,全不选
- 1599. 【GDKOI2004】香樟树
- Linux内核整体架构
- 【LeetCode解答六】Integer to Roman问题Java解答
- OpenVSwitch介绍
- android 使用adb工具抓日志,,,,抓网络包:
- 全选、反选
- springmvc中的文件上传
- C语言-计算长方形的面积
- Spark性能调优——扩展篇
- 四大组件之Service
- git/git-bash中的branch、checkout指令(git指令)
- 需要排序的最短子数组的长度
- 20171101
- bzoj 1969: [Ahoi2005]LANE 航线规划 离线+树链剖分+线段树