作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
这是我的 jsfiddle 获取 currentRowindex 如何获取开始时间和结束时间。 用户可以拖动类(第 7、第 8、第 9..)单元格并选择时间。用户已限制不能选择超过 3 个单元格 我正在获取 currentRowindex。如何使用 rowIndex 获得时间。
var currentRow1 = $('.csstdhighlight').closest('td').parent()[0].sectionRowIndex;
最佳答案
这确实是一个肮脏的编码,但解决了你的问题..
firstMin = $(".csstdhighlight").closest('tr').eq(0).find('td').eq(1).text().trim();
for(i=0;i<4;i++) {
var firstResult = $('#tableAppointment tr').eq(rowIndex-i).find('td').eq(0).text().trim();
if(firstResult !="") {
firstHour = firstResult.replace(":00AM","").replace(":00PM","").trim();
}
}
lastMin = $('#tableAppointment tr').eq(lastRow).find('td').eq(1).text().trim();
for(i=0;i<4;i++) {
var lastResult = $('#tableAppointment tr').eq(lastRow-i).find('td').eq(0).text().trim();
if(lastResult !="") {
lastHour = lastResult.replace(":00AM","").replace(":00PM","").trim();
}
}
alert("[" + firstHour + ":" + firstMin + "] - [" + lastHour + ":" + lastMin + "]");
玩过你的演示版.. http://jsfiddle.net/BerkerYuceer/Ybp4m/
您可以从这里根据您的需求改进它..
关于jquery - 获取 currentRowindex 如何获取开始时间和结束时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13027425/
JS fiddle 这是我的 jsfiddle 获取 currentRowindex 如何获取开始时间和结束时间。 用户可以拖动类(第 7、第 8、第 9..)单元格并选择时间。用户已限制不能选择超过
我是一名优秀的程序员,十分优秀!