I was able to create a sortable list using the jQuery sortable() method. I
could not find documentation on creating/accessing custom tiddler fields in
JS. so instead, I created a hidden div to store the sort order. Something
like this:
*<html>
<style>
.hidden {
display:none;
}
</style>
<ul id="sortable"></ul>
<div id="sortOrder" class="hidden"></div>
</html>*
I then access the list with:
*var arr = jQuery("#sortOrder").html().split("|");*
and write changes back with:
*var data = jQuery("#sortable li").map(function() { return
jQuery(this).html(); }).get();
var serialStr = data.join("|");
jQuery("#sortOrder").html(serialStr);*
I suppose using the hidden div is a bit of a hackābut it seams to works
fine.
On Thursday, March 7, 2013 3:28:28 PM UTC-8, PMario wrote:
>
>
>
> On Thursday, March 7, 2013 4:22:05 PM UTC+1, Tobias Beer wrote:
>>
>> I could swear I have looked for just that and couldn't find it. Now it
>> kind of dawn's on me why: I probably never hit that save bookmark.
>>
>
> You are right. The last time I did upload the stuff to TiddlySpot, it
> seems I didn't create the sort fields first. So they are gone. :/ I'll need
> to fix that.
>
> I did create a 3min video, that shows how it works.
> https://www.youtube.com/watch?v=jfXAACS2TGk
>
> I did the lazy loading, because sorting isn't used all the time and I
> don't want to include jQueryUI because of its size.
>
> -m
>
>
>
--
You received this message because you are subscribed to the Google Groups
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywikidev?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.