By: Vincent
Date: 2011-07-02
Time: 16:34
|
mergeblock array -> result is not sortableHi,
Every few months I get a sudden urge to work on my app, and I'm always glad to come back here to see what has changed in TBS. (I will be looking to the new PDO-feature!) I'm trying to get my tables sortable. Since I'm using jQuery already, I have tries 4 or 5 jQuery plugins already, but none of them seem to work, so I guess it might be related to TBS, or the way I'm using TBS. Most of my tables are built with
One of the plugins (dataTables) can handle server-side code: you provide it with a json file and some settings, and it creates the table for you. So now I'm thinking: how should I provide the dataTables-code in my <head>-template with the json-file through TBS? Or am I making things overly complex and should it work much easier? |
||
By: Skrol29
Date: 2011-07-03
Time: 00:28
|
Re: mergeblock array -> result is not sortableHi,
If you cannot make jQuery to sort the HTML table, this is a jQuery problem. Take a stable HTML result of your TBS merge, and start your jQqery debugging from this base. When you'll found the solution, you'll see if there is something to change in the template. Now if you want tp use the dataTable plug-in that requires only json data, then you don't need TBS at the server side for this. The PHP function json_encode() can format any data into json. I guess that this plug-in need only the data, the header information should probably be a configuration to give to the Table Builder. |
||
By: Vincent
Date: 2011-07-03
Time: 11:01
|
Re: mergeblock array -> result is not sortableI like your very fast replies, thank you very much!
I have taken your suggestion and made a static table, only to see that everything is working for dataTables. But if I provide the data dynamically with TBS, then it only formats the table and adds a 'no data in table' - functions like filtering, sorting etc. are not available. Will look into the json-thing. THX again! |
||
By: Vincent
Date: 2011-07-03
Time: 13:00
|
Re: mergeblock array -> result is not sortableSince jquery.dataTable did not seem to work well with TBS supplying the table through mergeBlock, I investigated the json-possibility, and it looks very promising.
It is much faster because the pagination works server-side and so the script doesn't have to fetch all 4433 rows from my dbase. This is how I'm using it now: Init:
I have seen someone suggesting on the forum changing htmlconv to 'js' or try some other values, but that doesn't work for the first character. Upgrading to TBS 3.7 also didn't work. Is this a bug or should I do something else? |
||
By: Vincent
Date: 2011-07-04
Time: 12:10
|
Re: mergeblock array -> result is not sortableBug apparently: if I work around it by removing the first '[' and adding it in the template, then everything works smoothly. The workaround is not that hard, so it doesn't really bother me (but it is a bug ;))
|
||
By: Sebastian
Date: 2011-12-20
Time: 09:53
|
Re: mergeblock array -> result is not sortableThis is a feature, not a bug. And there is a solution to it. Just found it here: http://www.tinybutstrong.com/support.php#faq_protect
|