I've got a classic table and I want to do selection on td elements of it except on the first column and on the first row of the table.

我有一个经典的表,我想对它的td元素进行选择,除了在第一列和表的第一行。

I've tried doing

我试过了

 $( ".calendarione table" ).not('tr:first-child').selectable({
        filter: "td.selectable_calendar_item",
    ...

But it doesn't work. (This example is relative to the first row). How can I do?

但它不起作用。 (此示例与第一行相关)。我能怎么做?

EDIT: This is the html: http://pastebin.com/VQDJhkA9 The first row represent the days of the month, clicking on them "a element" I will open close the date of all rooms (the next rows items).

编辑:这是html:http://pastebin.com/VQDJhkA9第一行代表一个月的日子,点击它们“一个元素”我将打开关闭所有房间的日期(下一行项目)。

The next rows represent the rooms (is an hotel rooms availability table), the first td element is the room name and the next td elements represent the status of the room on each day.

下一行代表房间(是酒店房间可用性表),第一个td元素是房间名称,下一个td元素代表每天房间的状态。

1 个解决方案

#1


0

Place first row in thead and make tbody selectable like below. Hope this will help you.

将第一行放在thead中并使tbody可选择如下所示。希望这会帮助你。

$("#selectable > tbody").selectable();
#selectable .ui-selecting {
  background: #FECA40;
}

#selectable .ui-selected {
  background: #F39814;
  color: white;
}

#selectable {
  width: 200px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.0-beta.1/jquery-ui.min.js"></script>

<table id="selectable">
  <thead>
    <tr>
      <td>1</td>
      <td>2</td>
      <td>3</td>
      <td>4</td>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>1</td>
      <td>2</td>
      <td>3</td>
      <td>4</td>
    </tr>
    <tr>
      <td>1</td>
      <td>2</td>
      <td>3</td>
      <td>4</td>
    </tr>
    <tr>
      <td>1</td>
      <td>2</td>
      <td>3</td>
      <td>4</td>
    </tr>
  </tbody>
</table>

更多相关文章

  1. 从Python中的列表元素中删除URL
  2. python selenium-webdriver 定位frame中的元素 (十三)
  3. Django模型选择:使用元组的第一个元素
  4. python 按位置关系输出矩阵元素
  5. 使用python如何在列表列表中找到元素,而关键元素是内部列表的元素
  6. 对numpy数组的每n个元素求平均值
  7. 008 Python基本语法元素小结
  8. Python根据第一项从2d数组中删除元素
  9. Python ElementTree“找不到元素”异常

随机推荐

  1. Your content must have a ListView whos
  2. android中JSON数据的读写方法
  3. Retrofit2.0+RxJava+MVP+Bmob的使用
  4. android activity
  5. Android中RelativeLayout各个属性的含义
  6. Android下的图形渲染配置文件egl.cfg
  7. 后台(02)——MySQL(2)
  8. AndroidStudio ListView 简单使用 (使用a
  9. Android Studio安卓学习笔记(二)Android
  10. Android外设AOA技术原理