有没有办法设置“项目”? jquery中的选项可以动态排序吗? [英] Is there any way to set the "item" options in jquery sortable dynamically?
本文介绍了有没有办法设置“项目”? jquery中的选项可以动态排序吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在带有左边距的div中有一个表:
I have a table in a div with left margin:
<div id="Div1" style="${fixedStyle}">
<div class="tblOuter" id="Div2" style="z-index: 1000;bottom: auto; overflow:hidden;">
<div class="tblInner" id="Div3" style="overflow:hidden;">
<table id="Table1" class="fixedColumn">
<thead>
<tr>
<th> </th>
<th>A</th>
<th>B</th>
<th>C</th>
<th>D</th>
<th>E</th>
{{tmpl($value) "#myDynamicColumn"}}
<th> </th>
<th style="width: 100%;"> </th>
</tr>
</thead>
</table>
</div>
</div>
<div class="tblOuter" id="Div4" style="z-index: 10;">
<div class="tblInner" id="Div5">
<table id="Table2" class="fixedColumn">
<thead>
<tr>
<th> </th>
<th>A</th>
<th>B</th>
<th>C</th>
<th>D</th>
<th>E</th>
{{tmpl($value) "#myDynamicColumn"}}
<th> </th>
<th style="width: 100%;"> </th>
</tr>
</thead>
//<tbody id='tbody1'></tbody>
<tbody><tr>
<th> </th>
<th>A</th>
<th>B</th>
<th>C</th>
<th>D</th>
<th>E</th>
{{tmpl($value) "#myDynamicColumn"}}
<th> </th>
<th style="width: 100%;"> </th>
</tr>
</tbody>
</table>
</div>
</div>
</div>
我想实现这个要求
另外,我正在实现jquery可排序。
I want to implement this "requirement"
Plus, I am implementing the jquery sortable.
$(tableBody).sortable("destroy"); //Remove soratable plugin if already applied.
$(tableBody).sortable({
placeholder: 'ui-state-highlight',
items:'tr.sortable-row',
update: function (event, ui) {
},
helper: function (e, ui) {
},
start: function (event, ui) {
},
forceHelperSize: true,
forcePlaceholderSize: true
}).disableSelection();
*现在我的问题是我已经给出了
* Now my issue is As I have given "
tr.sortable-row
到项目:选项。
拖动行的一半非冻结列只是拖动。 :(
我尝试了什么:
i试图设置项目选择器通过替换它的margin-left:-400px(正如我之前给出的那样)。
无法设置。
" to items:options.
While dragging the row half "non-freeze" column is only dragging. :(
What I have tried:
i have tried to set the item "selector" by replacing its margin-left: -400px(as i have given earlier).
couldn't able to set.
推荐答案
{fixedStyle} >
< div class = tblOuter id = Div2 < span class =code-attribute> style = z-index:1000; bottom:auto;溢出:隐藏; >
< div class = tblInner id = Div3 样式 = 溢出:隐藏; >
< 表 id = 表1 class = fixedColumn >
< thead >
< tr >
< th > & nbsp; < / th >
< th > < / th >
< > B < / th >
< th > C < / th >
< th > D < / th >
< th > E < / th >
{{tmpl(
{fixedStyle}"> <div class="tblOuter" id="Div2" style="z-index: 1000;bottom: auto; overflow:hidden;"> <div class="tblInner" id="Div3" style="overflow:hidden;"> <table id="Table1" class="fixedColumn"> <thead> <tr> <th> </th> <th>A</th> <th>B</th> <th>C</th> <th>D</th> <th>E</th> {{tmpl(
value)#myDynamicColumn}}
< th > & nbsp; < / th >
< th style = width:100%; > & nbsp; < / th >
< / TR>
< / thead >
< / table >
< / div >
< / div >
< div class = tblOuter id = Div4 style = z-index:10; >
< div class = tblInner id = Div5 >
< table id = 表2 class = fixedColumn >
< thead >
< tr >
< th > & nbsp; < / th >
< th > < / th >
< th > B < / th >
< th > C < / th >
< th > D < / th >
< th > E < / th >
{{tmpl(
value) "#myDynamicColumn"}} <th> </th> <th style="width: 100%;"> </th> </tr> </thead> </table> </div> </div> <div class="tblOuter" id="Div4" style="z-index: 10;"> <div class="tblInner" id="Div5"> <table id="Table2" class="fixedColumn"> <thead> <tr> <th> </th> <th>A</th> <th>B</th> <th>C</th> <th>D</th> <th>E</th> {{tmpl(
value )#myDynamicColumn}}
< th > & nbsp; < / th >
< th style = width:100%; > & nbsp; < / th >
< / tr >
< / thead >
// < tbody id =' tbody1' > < / tbody >
< tbody > < tr >
< th > & nbsp; < / th >
< th > < / th >
< th > B < / th >
< th > C < < span class =code-leadattribute> / th >
< th > D < < span class =code-leadattribute> / th >
< th > E < < span class =code-leadattribute> / th >
{{tmpl(
value) "#myDynamicColumn"}} <th> </th> <th style="width: 100%;"> </th> </tr> </thead> //<tbody id='tbody1'></tbody> <tbody><tr> <th> </th> <th>A</th> <th>B</th> <th>C</th> <th>D</th> <th>E</th> {{tmpl(
这篇关于有没有办法设置“项目”? jquery中的选项可以动态排序吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文