Fallenreaper
Fallenreaper

Reputation: 10684

How can i modify sortable textboxes while also being able to add text?

I have 2 varients in my code.

I have a table that i add sortable() to and if you swap the comments, it adds to it sortable({cancel:"th"});

I was curious how to do this? How would i make it so if i click the textbox has focus, but if i drag it will start the sorting procedure.

http://jsfiddle.net/8RtzL/

Right now, if i do 1 way, it wont let me focus to add text, and if i do it the other way, it does not make it easy to grab to sort the object

Upvotes: 0

Views: 38

Answers (1)

superUntitled
superUntitled

Reputation: 22527

http://jsfiddle.net/8RtzL/2/

You need to cancel the inputs as well. I would give the table elements some padding and background color, or look into a draggable handle element.

$("table.title > tbody").sortable({cancel:"input, th"});

Upvotes: 1

Related Questions