// Query
<script src="http://code.jquery.com/jquery-1.8.2.js" type="text/javascript"></script>
//Css
<style type="text/css">
.Colorcss{ background-color:#93BD00; cursor:pointer;}
</style>
<script type="text/javascript" language="javascript">
///////Start**************************OnClick
function jScript() {
$(function () {
$('#<%=Gridview.ClientID%> td').click(function () {
$(this).toggleClass("Colorcss");
checkva1();
});
});
var md = "";
var ms = "";
var scv = "";
$(function () {
$('#<%=Gridview.ClientID%> td').mousedown(function () {
md = $(this).index();
});
});
$(function () {
$('#<%=Gridview.ClientID%> td').mouseup(function () {
ms = $(this).index();
var trr = $('#<%=gvTimeSlot.ClientID%>').find('tr');
if (ms < md) { scv = ms; ms = md; md = scv; }
for (var i = md; i <= ms; i++) {
trr.find('td').eq(i).toggleClass("Colorcss");
}
checkva1();
});
});
}
Sys.Application.add_load(jScript);
function checkva1() {
var trr = $('#<%=Gridview.ClientID%>').find('tr');
var tdc = trr[0].cells.length;
var $tds = trr.find('td');
var Tivalue = "";
var co = "rgb(147, 189, 0)";
for (var rt = 0; rt < tdc; rt++) {
if ($tds.eq(rt).css("background-color") == co) {
Tivalue = Tivalue + "1";
}
else {
Tivalue = Tivalue + "0";
}
}
}
alert(Tivalue);
return false;
}
</script>
<script src="http://code.jquery.com/jquery-1.8.2.js" type="text/javascript"></script>
//Css
<style type="text/css">
.Colorcss{ background-color:#93BD00; cursor:pointer;}
</style>
<script type="text/javascript" language="javascript">
///////Start**************************OnClick
function jScript() {
$(function () {
$('#<%=Gridview.ClientID%> td').click(function () {
$(this).toggleClass("Colorcss");
checkva1();
});
});
var md = "";
var ms = "";
var scv = "";
$(function () {
$('#<%=Gridview.ClientID%> td').mousedown(function () {
md = $(this).index();
});
});
$(function () {
$('#<%=Gridview.ClientID%> td').mouseup(function () {
ms = $(this).index();
var trr = $('#<%=gvTimeSlot.ClientID%>').find('tr');
if (ms < md) { scv = ms; ms = md; md = scv; }
for (var i = md; i <= ms; i++) {
trr.find('td').eq(i).toggleClass("Colorcss");
}
checkva1();
});
});
}
Sys.Application.add_load(jScript);
function checkva1() {
var trr = $('#<%=Gridview.ClientID%>').find('tr');
var tdc = trr[0].cells.length;
var $tds = trr.find('td');
var Tivalue = "";
var co = "rgb(147, 189, 0)";
for (var rt = 0; rt < tdc; rt++) {
if ($tds.eq(rt).css("background-color") == co) {
Tivalue = Tivalue + "1";
}
else {
Tivalue = Tivalue + "0";
}
}
}
alert(Tivalue);
return false;
}
</script>
No comments:
Post a Comment