last day (33 days later) » 

9:51 AM
hi
 
i have to find span tag in table and check wheather contains text or not if contains text then make that row yellow.
running fiddlw
 
$("table").find("span").text() may help you
 
i have make my rowspan dynamic var cells = $('#tableAppointment tbody tr td:nth-child(3)');


var i = 0;
var topcell = false;

cells.each(function ()
{
var $cell = $(this);

if ($cell.hasClass('csstdhighlight'))
{
if (i == 0)
{
$cell.find('span').text(jQuery('#<%=txtPatientName.ClientID%>').val());
topcell = $cell;
}
else
{
$cell.remove();

}
i++;
}
});
if (topcell && i > 1) topcell.attr('rowspan', i);
Html
<table id="tableAppointment" cellspacing="1" width="50%" bgcolor="#cccccc" align="center">
<thead>
<tr>
<td bgcolor="#ffffff" width="70px">
</td>
<td class="csstablelisttd" width="70px">
<b>Time Slot&nbsp;</b>
</td>
<td class="csstablelisttd">
<b>&nbsp;Patient Name</b>
</td>
</tr>
</thead>
<tbody>
<tr>
<td class="csstablelisttd" valign="top" width="70px">
8:00AM
</td>
<td class="csstablelisttd">
0
</td>
<td class="csstablelisttd">
<span></span>
</td>
</tr>
<tr>
<td class="csstablelisttd">
</td>
 
See i am quite unable to understand your code but for your question
i have to find span tag in table and check wheather contains text or not if contains text then make that row yellow.
<html><head>
<script src="jquery.js"></script><script>
$(function(){
$("span").click(function () {
if($(this).text())
{
$(this).parents("tr").css("background","#ccffcc");} });
});</script> </head> <body>
<table>
<tr><td><span></span></td></tr>
<tr><td><span>Hi</span></td></tr>
</table></body></html>
 
10:07 AM
u didnt get my point i will explain
 
you can also explain in hindi
 
ok
all code needed see i am selecting time slot by dragging on time slot cell. if i allot time slot for 10 minutes then time slot color is green and at the same time when allot next time slot then previous time slot(10 minutes time slot) have to make yellow.Thats it
got
samjha kya
 
nahi
isme dragging to kahi dikh hi nahi rahi hai
 
in hindi me batat hu
0 pe mouse drag karo aur straight forward 15,30 aise drag karte jao
 
10:24 AM
haan ek alert box aaya 30 minutes ke baad
 
user 30 minute ka slot hi select kar sakta hai
isliye
 
Time slot not more than 30 minutes
 
abhi tum textbox me value dalo aur button click karo dekhoge ki textbox ki value time slot ko assign ho gayi
yaha tak samajha me aaya kya
 
haan ho gayi
patient name ke neeche value aa gayi
 
barabar
ab tum abhi dusra time slot select karo 10 minute ka
9 am ke niche wala ya koi bhi
 
10:28 AM
kar diya
 
abhi tum textbox me value dalo aur button click karo
 
uske aage value aa gayi
kar di
 
abhi tum dekh rahe ho ge ki pehla time slot ka color green tha wo gaya aur jo new time slot select kiya uska color green aa gaya
 
haan bilkul
 
abhi dekho mujhe kya karna hai.Jo pehla wala time slot tha na uska color yellow karnna hai means user ko dikhna chaiye ki wo time slot already alloted hai
on client side dikhna chaiye
 
10:32 AM
ok now let me try
 
thik hai
 
10:48 AM
agar koi dusra logic laga sakte hot dekho mere logic ke ilava (find span text....)
 
11:02 AM
try kar rahe ho kya bhai
 
ok
 
agar span mein value hai to overwrite kyu nahi kar dete ho
check karne ka jhanjhat nahi rahe ga
 
lekin user at a time 1 2 or 3 appointment add kar sakta hai
multiappointment at a time
so
 
11:24 AM
you will need jquery 1.7
it is working fine in my computer but not in jsfiddle
 
and also selecting all cell we have o select second celll of evry row
 
only second cell?
 
yes
u refre my fiddle jsfiddle.net/vrW2n/9
how it works
selecting second cell and add class to third cell'csstdhighlight'
 
working fine now everywhere
@Nikhil hello
......
are you there
 
11:49 AM
ya tell me
it works pretty
u r master
alert not showing
post me full page code i unable to see html
in fiddle
 
12:10 PM
r u there
header is selecting
alert not showing
 
12:36 PM
r u there
 
12:50 PM
iam back
electricity was gone
<html><head>
<style>.yell{background:#CCFF00;}.csstd
{
background-color: #ccffcc;
}
table{
background-color: #cccccc;

}</style><script src="jquery.js"></script>
<script>
$(function(){

$(document).mouseup(function(e){document.onmousemove=null;});
$(".csstablelisttd").mousedown(function(e){sen=$(this);
$(".csstd").removeClass("csstd");
sen.children(":not(:first)").addClass("csstd");
xco=e.clientX;
yco=e.clientY;
document.onmousemove=dra;
return false;
});
function dra(e){
if (e == null) { e = window.event;}
the complete code
hello @MehulPatel
 
@Somebodyisintrouble hello
 
hi mehul
 
So nikhil is now alert box showing
 
now pasting ur code in html file and chk
 
be sure that jquery.js file is in your same folder
 
12:57 PM
1.7
version
 
i will download 1.7
ok
 
@Nikhil Hey
 
target.parentNode' is null or not an object
getting error
 
ok let me see
working fine in my mozilla firefox
which browser are you using
 
1:02 PM
ie 8
 
@Nikhil Where are you form ?
 
do you have any other browser
he is from pune @MehulPatel
 
@Somebodyisintrouble ok ok
 
but my client want in iE
]
8
strictly
 
ok
try this
<html><head>
<style>.yell{background:#CCFF00;}.csstd
{
background-color: #ccffcc;
}
table{
background-color: #cccccc;

}</style><script src="jquery.js"></script>
<script>
$(function(){

$(document).mouseup(function(e){document.onmousemove=null;});
$(".csstablelisttd").mousedown(function(e){sen=$(this);
$(".csstd").removeClass("csstd");
sen.children(":not(:first)").addClass("csstd");
xco=e.clientX;
yco=e.clientY;
document.onmousemove=dra;
return false;
});
function dra(e){
if (e == null) { e = window.event;}
 
1:05 PM
ok just a minute
same error when i start drag in IE*
8
 
write your error
because now i have not used parentNode
 
target.parentNode' is null or not an object
 
Line: 38
Error: 'target.parentNode' is null or not an object
 
1:29 PM
dude are you here
 
yes
dude
 
try this one and it's the best i can done
<html><head>
<style>.yell{background:#CCFF00;}.csstd
{
background-color: #ccffcc;
}
table{
background-color: #cccccc;

}</style><script src="jquery.js"></script>
<script>var is=false;
$(function(){

$(document).mouseup(function(e){is=false;});
$(".csstablelisttd").mousedown(function(e){sen=$(this);
$(".csstd").removeClass("csstd");
$(this).children(":not(:first)").addClass("csstd");
xco=e.clientX;
yco=e.clientY;
is=true;
return false;
});
document.onmousemove=function(){return false;};
$(".csstablelisttd").mouseenter(function(){
 
m chking
it fails in IE8
same error
target.parentNode' is null or not an object
works in ff
 
so listen now you can ask this question on stackoverflow
 
ok
and in ff rowspan issue
dude
 
1:34 PM
yeah css solution work or not
 
did u see
 
yes
because i have not removed rows like you
 
by removing row its perfect
shall u remove row in ur soln
 
i will correct it but first of all go and mark my answer as aceepted
 
ok
type ur answer
in question
selection starts from header did u see tht
 
1:37 PM
try this <html><head>
<style>.yell{background:#CCFF00;}.csstd
{
background-color: #ccffcc;
}
table{
background-color: #cccccc;

}</style><script src="jquery.js"></script>
<script>var is=false;
$(function(){

$(document).mouseup(function(){is=false;});
$(".csstablelisttd").mousedown(function(e){sen=$(this);
$(".csstd").removeClass("csstd");
$(this).children(":not(:first)").addClass("csstd");
xco=e.clientX;
yco=e.clientY;
is=true;
return false;
});
document.onmousemove=function(){return false;};
$(".csstablelisttd").mouseenter(function(){
 
chking
 
do you know why this program become so difficult
 
bolo
kyu
 
kyunki tum rowspan ko change kar rahe ho jo ki bahut hi galat baat hai
aur dusri ab naye code future mein table use karke mat banana
it's too much outdated now
 
mujhe patient name combine karna hai time slot ke sath
div is difficult
 
1:43 PM
ok now go and ask question about ie8
Good bye:-)
 
thanks and gb
tc
 

  last day (33 days later) »