function gridBind(){
$("input[_l_key='checkbox']").each(function() {
var $this = $(this);
$this.unbind("click").bind("click", function(){
if($this.prop("checked") == false){
// 取消选择
srTradingId = 0;
}else{
onlySelectOne();
}
});
});
$("input[pagid='paging']").each(function() {
var $this = $(this);
$this.unbind("click").bind("click", function(){
$this.attr("checked",false);
allSelectedClick();
});
});
}
/**
* 把左边grid全选的效果取消
*/
function allSelectedClick(){
$("input[_l_key='checkbox']").each(function() {
var $this = $(this);
if($this.attr("value") == srTradingId){
$this.attr("checked",true);
}else{
$this.attr("checked",false);
}
});
}
/**
* 把左边grid改为只能同时选中一个
*/
function onlySelectOne(){
$("input[_l_key='checkbox']").each(function() {
var $this = $(this);
if($this.attr("value") == srTradingId){
$this.attr("checked",false);
}
});
srTradingId = grid.selectRow()[0].id;
}
$("input[_l_key='checkbox']").each(function() {
var $this = $(this);
$this.unbind("click").bind("click", function(){
if($this.prop("checked") == false){
// 取消选择
srTradingId = 0;
}else{
onlySelectOne();
}
});
});
$("input[pagid='paging']").each(function() {
var $this = $(this);
$this.unbind("click").bind("click", function(){
$this.attr("checked",false);
allSelectedClick();
});
});
}
/**
* 把左边grid全选的效果取消
*/
function allSelectedClick(){
$("input[_l_key='checkbox']").each(function() {
var $this = $(this);
if($this.attr("value") == srTradingId){
$this.attr("checked",true);
}else{
$this.attr("checked",false);
}
});
}
/**
* 把左边grid改为只能同时选中一个
*/
function onlySelectOne(){
$("input[_l_key='checkbox']").each(function() {
var $this = $(this);
if($this.attr("value") == srTradingId){
$this.attr("checked",false);
}
});
srTradingId = grid.selectRow()[0].id;
}