+ Reply to Thread
Page 5 of 15 FirstFirst ... 3 4 5 6 7 ... LastLast
Results 41 to 50 of 147

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

  1. #41

    Default Same Undefined error

    Quote Originally Posted by neilw View Post
    That is always helpful.

    All I can think in this case is that you didn't save the template to a template page. Meaning, you needed to:
    1) Go to "Templates"
    2) Click "New page"
    3) Paste in TSTable
    4) Save

    That is the only way it will be properly saved "as a template". When you go to "Templates", do you see TSTable in the list? If so, and you still get the error, then definitely post back with more info.
    Hello, I'm having the same problem as Jonverve. Mine also works when I put all of the code in the same page as my table. My code is also stored in the templates area and the template shows up in my Insert Template tool drop-down. I've included my source text:
    Code:
    <h1>Table Test</h1>
    <pre class="script">
    TSTable();
    stolenvehicles.table("SELECT top 25 Color1 as Color, YR as Year, Make, Model, 
    Lic_Plate as License, Location, convert(varchar,RPT_Date,1) as Date&nbsp;FROM stolens 
    where recovered=0 order by rpt_date desc")&nbsp;</pre>
    Also, when I have the code in the same page, the text of the column titles have a border around them, which looks very odd as it is inside the border the cell of the table and it goes right through the sort button...
    Attached Images  

  2. #42
    Join Date
    Mar 2008
    Posts
    1,630

    Default

    Quote Originally Posted by bduran View Post
    Hello, I'm having the same problem as Jonverve. Mine also works when I put all of the code in the same page as my table. My code is also stored in the templates area and the template shows up in my Insert Template tool drop-down. I've included my source text:
    I continue to be vexed by these problems. However, rather than treat the symptom, I will attempt to cure the disease. If you would be so kind, please try out the new installation instructions (I just put them there) on the TSTable page and let me know if they work better for you. Rberinger and I put a lot of time into refining these, in the interest of avoiding these issues in the future.

    Also, when I have the code in the same page, the text of the column titles have a border around them, which looks very odd as it is inside the border the cell of the table and it goes right through the sort button...
    Argh. What browser are you using?

  3. #43

    Default

    Quote Originally Posted by neilw View Post
    I continue to be vexed by these problems. However, rather than treat the symptom, I will attempt to cure the disease. If you would be so kind, please try out the new installation instructions (I just put them there) on the TSTable page and let me know if they work better for you. Rberinger and I put a lot of time into refining these, in the interest of avoiding these issues in the future.
    I don't know what was different from your source and mine, but that definitely did the trick - Thanks!

    Quote Originally Posted by neilw View Post
    Argh. What browser are you using?
    IE8, however that doesn't appear to be the problem. I tested on IE7, Chrome, and Firefox and they all look the same. I believe the problem is the type of table this is being applied to. This table is being created by the MS SQL extension using the .table parameter.

    Also, I don't want to hijack this thread so if this belongs somewhere else please let me know: How do I use the template in generate mode with a SQL query? I've tried the RecordList parameter with the MS SQL extension, but that didn't work well. Try as I might, I couldn't figure out how to define the columns and the data.
    Last edited by bduran; 02-09-2010 at 05:11 PM.

  4. #44
    Join Date
    Mar 2008
    Posts
    1,630

    Default

    Quote Originally Posted by bduran View Post
    I don't know what was different from your source and mine, but that definitely did the trick - Thanks!
    IE8, however that doesn't appear to be the problem. I tested on IE7, Chrome, and Firefox and they all look the same. I believe the problem is the type of table this is being applied to. This table is being created by the MS SQL extension using the .table parameter.
    Ah. I'll have to look into that at some point, but for this particular application "generate" mode is clearly your best bet.

    Also, I don't want to hijack this thread so if this belongs somewhere else please let me know: How do I use the template in generate mode with a SQL query? I've tried the RecordList parameter with the MS SQL extension, but that didn't work well. Try as I might, I couldn't figure out how to define the columns and the data.
    This is certainly TSTable-related, so it's fine here.

    The recordlist() function should be perfect, in what way exactly didn't it work well for you? The data you get from recordlist() is a list of maps, so it's ready to be passed directly to TsTabl as the data argument. Here's a really simple way to make it work:

    Code:
    var recordlist = mssql.recordlist(query);
    
    if (#recordlist) {
      tstable{
        columns: map.keys(recordlist[0]),
        data: recordlist
      }
    }
    This, of course, doesn't let you control the order of the columns. To do that, you would replace the "map.keys" expression with the list of columns in the order you want, and of course if you want to specify more column attributes you can use the advanced "columns" form.

    If there is any part of this that is unclear or just not working for you, then let me know and we'll work through it.

    I had actually been planning to put in a mode that would automatically generate the columns list like in the above example, so you wouldn't need to specify columns at all if you didn't care about the order they came out in. I'll have to add that in one of these days...

  5. #45

    Default

    Quote Originally Posted by neilw View Post
    Code:
    columns: map.keys(recordlist[0]
    It was the map.keys part that I was missing. Thank you.
    Any thoughts as to why the borders are showing up around the column heading labels? Even in generate mode, it still happens.

  6. #46

    Default TSTable is not working at all

    I installed the templates and all other files as descibed on the main page for TSTable.
    A silmpe Test does not do anything to my table. Adding a string like "Is this script running?"; to the script will be displayed at the position where {{TSTable()}} is invoked. So the script is being executed.
    What's going wrong? I don't get any error messages. {{TSTable()}} just generates some spaces before my table.
    We are using the wiki version "9.08.1.16666".
    Thanks in advance.

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

    Default

    Quote Originally Posted by bduran View Post
    It was the map.keys part that I was missing. Thank you.
    Any thoughts as to why the borders are showing up around the column heading labels? Even in generate mode, it still happens.
    This is still on all browsers? If so, then what skin are you using?

    I dunno what could be going on here; I've had browser-specific issues before, but not one that affects all. I'll see if I can figure something out.

  8. #48
    Join Date
    Mar 2008
    Posts
    1,630

    Default

    Quote Originally Posted by frahe View Post
    I installed the templates and all other files as descibed on the main page for TSTable.
    A silmpe Test does not do anything to my table. Adding a string like "Is this script running?"; to the script will be displayed at the position where {{TSTable()}} is invoked. So the script is being executed.
    What's going wrong? I don't get any error messages. {{TSTable()}} just generates some spaces before my table.
    We are using the wiki version "9.08.1.16666".
    Thanks in advance.
    Sounds like it can't find your table. Can you post the HTML source of your wiki page (go into editor source mode), at least of the part including the tstable call and the beginning of you table? This is something simple...

  9. #49

    Default

    Hello Neil,
    Thanks for the quick response. Im just a beginner so this might be a simple error of mine...
    Here's the source code of the simplest test:

    <h1>Tabletest</h1>
    <p>{{TSTable();}}</p>
    <table cellspacing="1" cellpadding="1" border="1" style="table-layout: fixed; width: 100%">
    <thead>
    <tr>
    <th scope="col">1</th>
    <th scope="col">2</th>
    </tr>
    </thead>
    <tbody>
    <tr>
    <td>2</td>
    <td>3</td>
    </tr>
    <tr>
    <td>4</td>
    <td>5</td>
    </tr>
    </tbody>
    </table>
    <p><br />
    &nbsp;</p>

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

    Default

    That code looks fine. In fact, it works perfectly on this page: http://developer.mindtouch.com/User:...esting/TSTable.

    My best guess is that there's some extraneous html in the template. Did you follow the latest and greatest instructions for installing the template? That should leave no room for error.

+ 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