首页 \ 问答 \ jQuery UI多重排序列:滚动问题(jQuery UI multiple sortable columns : issue with scrolling)

jQuery UI多重排序列:滚动问题(jQuery UI multiple sortable columns : issue with scrolling)

jQuery:1.9.1

jQuery UI:1.10.1

请看小提琴

            <td class="my-column" >
                <div id="my-div1" class="my-div-class">
                    <p class="para-item"> para 101 </p>
                </div>
            </td>
            <td>
                <div id="my-div1" class="my-div-class">
                    <p class="para-item"> para 201 </p>
                </div>
            </td>

<script>
    $(".my-div-class").sortable( { connectWith: '.my-div-class' } );
</script>

在小提琴中,当用户尝试将列表1中的顶部项目拖动到列表2的底部时,列表1的滚动条被移动而不是列表2的滚动条。

尝试各种事情,但无法使其正常工作。 任何输入/建议都非常感谢。

谢谢,拉克什


jQuery : 1.9.1

jQuery UI : 1.10.1

Please See The Fiddle

            <td class="my-column" >
                <div id="my-div1" class="my-div-class">
                    <p class="para-item"> para 101 </p>
                </div>
            </td>
            <td>
                <div id="my-div1" class="my-div-class">
                    <p class="para-item"> para 201 </p>
                </div>
            </td>

<script>
    $(".my-div-class").sortable( { connectWith: '.my-div-class' } );
</script>

In the fiddle, when user tries to drag top item in list-1 into bottom of list-2, the scroll bar of list-1 gets moved instead of list-2 scroll bar.

Tried various things but couldnt make it to work properly. Any inputs/suggestions are much appreciated.

Thanks, Rakesh


原文:https://stackoverflow.com/questions/16794882
更新时间:2023-07-19 20:07

最满意答案

尝试一下:

op <- merge(df1,df2, 
      all.x = TRUE,
      all.y = TRUE) 

op$df1 <- 1*(op$V1 %in% df1$V1)

op$df2 <- 1*(op$V1 %in% df2$V1)

> op
                                                                               V1 df1 df2
1                                                        A0A061ACH4;Q95Q10;Q9U1W6   1   1
2                                                        A0A061ACL3;Q965I6;O76618   1   1
3                                                 A0A061ACR1;Q2XN02;F5GUA3;Q22498   1   1
4                                                           A0A061AJJ3;A0A061AEA8   1   1
5                                                                      A0A061AL01   1   1
6                                                                          C1P641   1   0
7  H2FLH3;H2FLH2;A0A061ACT3;A0A061AE24;Q23551-2;Q23551;Q23551-4;Q23551-3;Q23551-5   1   1
8                                                               Q22501;A0A061AE05   1   1
9                                                                          Q86CZ7   1   1
10                                                                         Q27GQ4   0   1

要么

library(dplyr)

op <- merge(df1,df2, 
             all.x = TRUE,
             all.y = TRUE) %>% 
        mutate(df1=1*(V1 %in% df1$V1),
               df2=1*(V1 %in% df2$V1))

以下是您的额外问题的答案:

- 知道df1和df2有多少行相似?

sum(df1$V1 %in% df2$V1) 

-df1中存在多少df1?

sum(!(df1$V1 %in% df2$V1))

-df2中存在多少df2中不存在的df2?

sum(!(df2$V1 %in% df1$V1))

Try this out:

op <- merge(df1,df2, 
      all.x = TRUE,
      all.y = TRUE) 

op$df1 <- 1*(op$V1 %in% df1$V1)

op$df2 <- 1*(op$V1 %in% df2$V1)

> op
                                                                               V1 df1 df2
1                                                        A0A061ACH4;Q95Q10;Q9U1W6   1   1
2                                                        A0A061ACL3;Q965I6;O76618   1   1
3                                                 A0A061ACR1;Q2XN02;F5GUA3;Q22498   1   1
4                                                           A0A061AJJ3;A0A061AEA8   1   1
5                                                                      A0A061AL01   1   1
6                                                                          C1P641   1   0
7  H2FLH3;H2FLH2;A0A061ACT3;A0A061AE24;Q23551-2;Q23551;Q23551-4;Q23551-3;Q23551-5   1   1
8                                                               Q22501;A0A061AE05   1   1
9                                                                          Q86CZ7   1   1
10                                                                         Q27GQ4   0   1

OR

library(dplyr)

op <- merge(df1,df2, 
             all.x = TRUE,
             all.y = TRUE) %>% 
        mutate(df1=1*(V1 %in% df1$V1),
               df2=1*(V1 %in% df2$V1))

And here are the answers for your extra questions:

-know how many lines from df1 and df2 are similar?

sum(df1$V1 %in% df2$V1) 

-how many of df1 exist which don't exist in df2?

sum(!(df1$V1 %in% df2$V1))

-how many of df2 exist which don't exist in df1?

sum(!(df2$V1 %in% df1$V1))

相关问答

更多
  • select * from tab WHERE substring_index(location1,' ',1)<> substring_index(location1,' ',1) 你不应该比较Location1和Location2吗? 我建议保持单词的大小写与你的表格相同。 IE使用Location而不是location。 select * from tab WHERE substring_index(location1, '', 1) <> substring_index(location1, '', ...
  • 尝试一下: op <- merge(df1,df2, all.x = TRUE, all.y = TRUE) op$df1 <- 1*(op$V1 %in% df1$V1) op$df2 <- 1*(op$V1 %in% df2$V1) > op V1 df1 df2 1 ...
  • 使用componentsSeperatedByString分隔字符串:使用任何字符串分隔单词(逗号,空格)并将结果放入NSSet。 对两个字符串执行此操作并比较集合是否相等。 使用mutableArray而不是Set的修改方法考虑到重复字符串的问题(如注释中所述): -(BOOL) string: (NSString*) string1 isEqualTo: (NSString*) string2 { if (string1.length != string2.length) return NO; ...
  • 如果速度是您所关心的,则在获取数据时可以使用Dictionary而不是Lists/Arrays // Key (string) - String value // Value (int) - repeat count Dictionary values = new Dictionary(); // Fill values: adding up v1, removing v2 using (IDataReader reader = myQuery.Exe ...
  • 如果你的字符串是唯一的(并且永远是唯一的),那么将它作为唯一的列和主键就可以了。 我使用单独ID的唯一原因是 它将来会在某个时刻变得不独特; 要么 如果它是一个大字符串,并且您希望另一个表列引用它(外键)。 我会将YAGNI原则应用于这两种情况,并在发生时对其进行担心。 另外,对于数据库应用程序,最好不要“在保存之前检查它是否已经存在”。 我倾向于只是尝试保存它并捕获错误,如果它存在。 由于它是主键(或唯一约束),因此可行。 检查存在然后插入经常导致竞争条件。 If your string is uniqu ...
  • 我不确定这是refinr的最佳用法,它主要用于统一单列中的单词拼写。 你想要做什么看起来像一个模糊的联合,并有一个R包 。 使用的一个例子可能是: library(tidyverse) library(fuzzyjoin) df1 <- tribble( ~uid, ~name, ~value, "A", "Red", 13, "A", "violet", 145, "B", "Blue", 3, "B", "yellow", 56, "C", "yellow-purple", ...
  • 你的morse变量似乎改变的原因是因为它指向了堆栈上的一个区域。 它指向堆栈区域的原因是因为您为其分配了参数english的地址,当您调用函数时它被压入堆栈,然后在函数完成后弹出堆栈。 现在你的莫尔斯变量将指向堆栈中相同位置的内存,这将在程序的整个生命周期中不断变化。 在我看来,解决这个问题的最好方法是从EnglishToMorse返回一个NULL指针,如果该字符不是AZ ...然后检查你的isMorse函数中的NULL指针。 毕竟,最好在代码中检查NULL指针。 char* EnglishToMorse( ...
  • 这个功能 phrasesWithWords <- function(x, table) { words <- strsplit(x, "\\W") found <- relist(unlist(words) %in% table, words) which(sapply(found, any)) } 在你的短语和可接受的单词表上工作: phrase <- c("I am fine", "He is fine", "am better", "better butter", ...
  • 替换线 if(!strcmp(Entered_Password, (set_password1||set_password2||set_password3||set_password4||set_password5)) 同 if (!(strcmp(Entered_Password, set_password1) && strcmp(Entered_Password,set_password2) && (strcmp(Entered_Password,set_password3) && strcmp(En ...
  • 这使用列表理解,因此它可能不是最快的解决方案,但工作简洁。 df['C'] = pd.Series(['Yes' if a in b else 'No' for a,b in zip(df['A'],df['B'])]) 编辑:如果您不想将值保留在C而不是用'否'覆盖它们,您可以这样做: df['C'] = pd.Series(['Yes' if a in b else c for a,b,c in zip(df['A'],df['B'], df['C'])]) This uses list compr ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。