How To Make A Single Element In A Not Sortable (jquery Ui)
I have a table like this Days Monday Tuesday WSolution 1:
Make the row headers <th>
as they should be and include only <td>
elements.
<table><trclass="sortable"><th>Days</th><td>Monday</td>
...
$( '.sortable' ).sortable({
items: 'td'
});
Solution 2:
You can use the cancel
option for this:
$('.sortable').sortable({
cancel: 'td:first'
});
Here's docs.
Solution 3:
<table><trclass="sortable"><td>Days</td><td>Monday</td><td>Tuesday</td><td>Wednesday</td><td>Thursday</td><td>Friday</td><td>Saturday</td></tr><trclass="sortable"><td>Works</td><td>1</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td></tr></table>
Let's make the column id not to be sortable.
$(".sortable").sortable({
items: "td:not(:first)"
});
That's all. All you need is to excludethe first td in items.
Have a great day
I have a table like this
Days | Monday | Tuesday | WSolution 1:Make the row headers
Solution 2:You can use the
Here's docs. Solution 3:
Let's make the column id not to be sortable.
That's all. All you need is to excludethe first td in items. Have a great day |
Post a Comment for "How To Make A Single Element In A Not Sortable (jquery Ui)"