Skip to content

Commit

Permalink
公开获取当前options
Browse files Browse the repository at this point in the history
  • Loading branch information
xucongli1989 committed Mar 25, 2017
1 parent dc80c8c commit 7fc9fd4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ XCheck为checkbox 全选/反选功能的 jquery插件,支持多页情况下保
<td>$.XCheck({...}).initVal(...)</td>
<td>根据指定的结果值,初始化插件状态</td>
</tr>
<tr>
<td>$.XCheck({...}).options</td>
<td>获取当前的options</td>
</tr>
</table>


Expand Down
13 changes: 9 additions & 4 deletions XCheck/XCheck.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
* 本插件支持单页及多页的全选、反选、清空选择
* 需要引用jquery,$.XCheck({option});
********************************************************************************************
* 当前版本:v1.0.0
* 更新时间:2016-02-04
* 当前版本:v1.1
* 更新时间:2017-03-25
*/
; (function (window, $, undefined) {

Expand Down Expand Up @@ -192,11 +192,12 @@
ops.clearCheckCurrentClass += ops.groupClass;
ops.reverseCheckCurrentClass += ops.groupClass;
ops.valueClass += ops.groupClass;
ops.selectInfo=new SelectedBaseInfo();

var $body = $("body");

var selectVal = [];
var selectInfo = new SelectedBaseInfo();
var selectInfo = ops.selectInfo;


//获取所有【要选择的每一项】的jquery对象
Expand Down Expand Up @@ -515,7 +516,11 @@
/**
* 根据指定的结果值,初始化插件状态
*/
initVal: _initVal
initVal: _initVal,
/**
* 当前选项options
*/
options:ops
};

};
Expand Down
2 changes: 2 additions & 0 deletions XCheck/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@
console.log("beforeCheckItem");
},
afterCheckItem:function(){
var ops=xcheck1.options;
console.log('当前的options为:'+JSON.stringify(ops));
console.log("afterCheckItem");
},
beforeClearCheck:function(){
Expand Down

0 comments on commit 7fc9fd4

Please sign in to comment.