【问题标题】:ui.selected is returning undefined when used with a tableui.selected 与表一起使用时返回未定义
【发布时间】:2015-04-23 00:23:54
【问题描述】:

Alert(id) 在表中使用时不返回任何内容。当我在“OL”标签上使用 jquery selectable 时,它​​返回“li”的 id,当我将“ol selectable”更改为“table selectable”时,它开始在警报消息中显示为空。当使用带有 jquery UI selectable 与 "ol" 的表时,我是否需要任何不同的东西。请建议。

 $("#selectable").selectable({
   selected: function (event, ui) {
   var id = $(ui.selected).attr("id");
   var color = $(ui.selected).css("border-color");
   alert(id);
   }
 });

【问题讨论】:

    标签: jquery-ui jquery-ui-selectable


    【解决方案1】:

    添加此过滤器:“td”有助于实现我想要的。我从jquery论坛得到了答案 https://forum.jquery.com/topic/jquery-selectable-as-table-not-returning-id 归功于 Jakecigar

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-01-19
      • 1970-01-01
      • 2020-09-09
      • 2011-10-09
      • 2019-06-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多