+ Reply to Thread
Page 3 of 15 FirstFirst 1 2 3 4 5 13 ... LastLast
Results 21 to 30 of 147

Thread: ANNOUNCE: TSTable() template, sortable/filterable table generator

  1. #21
    Join Date
    Mar 2008
    Posts
    1,630

    Default

    Quote Originally Posted by csivils View Post
    On a more serious note, the exact same solution also worked for Blake's datatable template. Not that anyone would think to look in this thread, but at least the information is now someplace.
    I will try to work on the documentation for how the date sorting works, at least for my template. The way the sorter analyzes the table to figure out how to sort is easy to understand at a high level, but very squirrelly once you get into the specifics. It took me a while to figure it all out myself. Datatables will likely suffer similarly, but with different details.

    In this case, though, I'm not at all surprised that they both behave the same, because the date format you were using had the dual undesirable properties of (a) looking like a standard format, and (b) not actually being one. Therefore, it would likely be confusing to any code that is trying to decipher it.

    Ultimately, by putting "20" in front of each date (great simple solution by the way), you caused it to fail to match any of the date formats (weird but true I think) and so it's correctly being sorted as text.

    I am not particularly happy with the way the format detection (especially for dates) is handled in the tablesorter code right now, and would love to redo it, but it's gonna take a lot of testing to make sure they're working properly, and I just don't have the time right now. Glad you were able to make it work for you!

  2. #22
    Join Date
    Nov 2008
    Location
    New Zealand
    Posts
    29

    Default

    Quote Originally Posted by neilw View Post
    Ha ha, I get it!

    Erm, anyway, if you post your code I'll try to help see what's going on. I don't understand the "click a top field it rolls everything up" explanation. Also, are you trying this on the Mindtouch wiki or your own?



    You can certainly have links in the table; I do this all the time. If the table already has links in it, then they will be retained. If you're using the table generator, then you have to make sure to generate the links either using an evaluated expression for the field, or create the links directly in your data argument.

    In any case, if I see your example then I can try to help you out with more specifics.

    Thanks for the feedback.
    Ok here it is:
    The code I used is basically your example
    TSTable {
    options: { pager:true, zebra:true },
    columns: ["Title", "Viewcount",
    {key:"uri", title:"URL of Page"}
    ],
    data: wiki.getpage('/').subpages

    }
    But it looks like this: Notice no bottom table sorter row.

    And if you click any of the header rows it 'rolls up' in fright!

    Any ideas?
    Attached Thumbnails Attached Thumbnails Click image for larger version

Name:	2009-08-25_124330.jpg‎
Views:	93
Size:	77.7 KB
ID:	894  
    Attached Images  

  3. #23
    Join Date
    Mar 2008
    Posts
    1,630

    Default

    Quote Originally Posted by zippgunn View Post
    Ok here it is:
    The code I used is basically your example

    But it looks like this: Notice no bottom table sorter row.

    And if you click any of the header rows it 'rolls up' in fright!

    Any ideas?
    First thing to note is that the pager doesn't display because you have fewer than 10 items in the table. When there's only one page to display, I hide the pager controls (much like a scrollbar that doesn't display unless needed).

    However, the "roll up" behavior is certain strange. I haven't seen it before, and I'll have to see if I can reproduce. Can you try disabling the pager, and see if it still does that?

  4. #24
    Join Date
    Nov 2008
    Location
    New Zealand
    Posts
    29

    Default

    Quote Originally Posted by neilw View Post
    First thing to note is that the pager doesn't display because you have fewer than 10 items in the table. When there's only one page to display, I hide the pager controls (much like a scrollbar that doesn't display unless needed).

    However, the "roll up" behavior is certain strange. I haven't seen it before, and I'll have to see if I can reproduce. Can you try disabling the pager, and see if it still does that?
    Ah yes, I forgot to say, but when disabling the pager everything works as normal, no "rollup".
    I'll see about using the pager on a list longer than 10 items and get back to you.

    Cheers.

  5. #25
    Join Date
    Nov 2008
    Location
    New Zealand
    Posts
    29

    Default

    Ok, tested with a list longer than 10 items and it works as expected.
    Thanks for the help.

  6. #26
    Join Date
    Mar 2008
    Posts
    1,630

    Default

    OK good. I'll look into the behavior of the pager with less than 10 items.

  7. #27
    Join Date
    Mar 2008
    Posts
    1,630

    Default

    Quote Originally Posted by zippgunn View Post
    Ok, tested with a list longer than 10 items and it works as expected.
    Thanks for the help.
    Bug has been squashed, version on wiki has been updated. Thanks for reporting the problem!

  8. #28
    Join Date
    Nov 2008
    Location
    New Zealand
    Posts
    29

    Default

    Quote Originally Posted by neilw View Post
    Bug has been squashed, version on wiki has been updated. Thanks for reporting the problem!
    No Problem, on a slightly side note, I was wondering about when using
    Code:
    wiki.getpage("page/path").subpages
    in the template if there is away it would return more than just the one sublevel, as I would like this table to display for all subpages if possible?
    Last edited by zippgunn; 08-25-2009 at 10:21 PM. Reason: edit code

  9. #29
    Join Date
    Mar 2008
    Posts
    1,630

    Default

    Quote Originally Posted by zippgunn View Post
    No Problem, on a slightly side note, I was wondering about when using
    Code:
    wiki.getpage("page/path").subpages
    in the template if there is away it would return more than just the one sublevel, as I would like this table to display for all subpages if possible?
    Sure. Try this:
    Code:
    wiki.getsearch("path:'page/path/*'")

  10. #30
    Join Date
    Mar 2008
    Posts
    1,630

    Default

    I've added the ability to supply a list of lists for the data parameter. This makes the table generator a bit more flexible, and enables a nice little CSV-parsing example which has been added to the documentation.

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts